Skip to content
Snippets Groups Projects
Commit 8ae2fbde authored by DFN2's avatar DFN2
Browse files

console log the relevent functions for current issue

parent 51cb86ae
No related branches found
No related tags found
No related merge requests found
Pipeline #1283 passed
{
"main.css": "static/css/main.8055198b.css",
"main.css.map": "static/css/main.8055198b.css.map",
"main.js": "static/js/main.f56fea9c.js",
"main.js.map": "static/js/main.f56fea9c.js.map",
"main.js": "static/js/main.560e4ab0.js",
"main.js.map": "static/js/main.560e4ab0.js.map",
"static/media/opendesktop-app.png": "static/media/opendesktop-app.77b1e6fa.png"
}
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="./favicon.ico"><link href="./static/css/main.8055198b.css" rel="stylesheet"></head><body><div id="root"></div><script type="text/javascript" src="./static/js/main.f56fea9c.js"></script></body></html>
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="./favicon.ico"><link href="./static/css/main.8055198b.css" rel="stylesheet"></head><body><div id="root"></div><script type="text/javascript" src="./static/js/main.560e4ab0.js"></script></body></html>
\ No newline at end of file
Source diff could not be displayed: it is too large. Options to address this: view the blob.
This diff is collapsed.
This diff is collapsed.
......@@ -60,8 +60,6 @@ function App(){
return getUserConfigUpdateAvailableItems;
}).then(function(res){
if (res.data.length > 0){
console.log('updates available');
console.log(res);
/*const combinedUpdateAvailableItems = {};
for (const value of Object.values(updateAvailableItems)) {
const itemKey = value.installed_item;
......@@ -80,6 +78,7 @@ function App(){
}
function setAppInfo(){
console.log(ocsApiState);
appDispatch({type:'SET_PACKAGE_JSON',packageJson:packageJson})
appDispatch({type:'SET_DOMAINS',domains:appConfig.domains});
setLoading(false);
......@@ -91,6 +90,8 @@ function App(){
ocsApiState.ocsManagerApi.sendSync('ItemHandler::metadataSet', [])
})
.set('ItemHandler::downloadStarted', (message) => {
console.log('download started')
console.log(message);
ocsApiDispatch({type:'SET_DOWNLOAD_ITEM',item:message.data[0].metadata});
// Download preview picture
const selector = 'meta[property="og:image"]';
......@@ -104,10 +105,12 @@ function App(){
) {
previewpicUrl = `${message.data[0].metadata.provider}content/previewpic/${message.data[0].metadata.content_id}`;
}*/
console.log(result);
if (previewpicUrl) ipcRenderer.sendSync('previewpic', 'download', message.data[0].metadata.url, previewpicUrl);
});
})
.set('ItemHandler::downloadProgress', (message) => {
console.log('download progress');
ocsApiDispatch({
type:'UPDATE_ITEM_DOWNLOAD_PROGRESS',
itemUrl:message.data[0],
......@@ -116,6 +119,7 @@ function App(){
})
})
.set('ItemHandler::downloadFinished', (message) => {
console.log('download started');
if (message.data[0].status !== 'success_download') console.error(new Error(message.data[0].message));
console.log(message.data[0].message)
ocsApiDispatch({
......
......@@ -67,33 +67,24 @@ function WebView(props){
webview.addEventListener('did-start-loading', () => {
browserDispatch({type:'SET_LOADING',loading:true})
setShowWebviewMask(true)
});
webview.addEventListener('did-stop-loading', () => {
browserDispatch({type:'SET_LOADING',loading:false});
if (appState.dialog.show === true) appDispatch({type:'HIDE_DIALOG'});
const webViewInitiScript =
`
var metaheader = document.querySelector('#metaheader');
if (metaheader){
metaheader.parentNode.removeChild(metaheader);
}
var odMetaHeader = document.querySelector('opendesktop-metaheader');
if (odMetaHeader){
odMetaHeader.parentNode.removeChild(odMetaHeader);
}
var gitLabNavBar = document.querySelector('header.navbar-gitlab');
if (gitLabNavBar){
gitLabNavBar.style.top = 0;
}
var forumsNavBar = document.querySelector('header.d-header');
if (forumsNavBar){
forumsNavBar.style.top = 0;
}
var body = document.querySelector('body');
body.style.paddingTop = 0;
`;
`var metaheader = document.querySelector('#metaheader');
if (metaheader){ metaheader.parentNode.removeChild(metaheader); }
var odMetaHeader = document.querySelector('opendesktop-metaheader');
if (odMetaHeader){ odMetaHeader.parentNode.removeChild(odMetaHeader);}
var gitLabNavBar = document.querySelector('header.navbar-gitlab');
if (gitLabNavBar){ gitLabNavBar.style.top = 0;}
var forumsNavBar = document.querySelector('header.d-header');
if (forumsNavBar){ forumsNavBar.style.top = 0;}
var body = document.querySelector('body');
body.style.paddingTop = 0;`;
webview.getWebContents().executeJavaScript( webViewInitiScript , false, (result) => {
setShowWebviewMask(false);
});
......@@ -118,12 +109,15 @@ function WebView(props){
});
webview.addEventListener('will-navigate', (event) => {
console.log('webview element: will navigate');
// See also "will-navigate" event handling in main.js
if (event.url.startsWith('ocs://') || event.url.startsWith('ocss://')) {
console.log('if event.url starts with ocs://')
const info = detectOcsApiInfo(webview.getURL());
console.log('info:');
console.log(info);
console.log('ocs manager - send: item handler::getItemByOcsUrl');
ocsApiState.ocsManagerApi.send('ItemHandler::getItemByOcsUrl', [event.url, info.providerKey, info.contentId]);
} else {
setShowWebviewMask(true);
}
});
......@@ -158,8 +152,6 @@ function WebView(props){
webviewMaskDisplay = <div id="webview-mask"></div>
}
console.log('show webiew mask - ' + showWebviewMask);
return (
<div id="webview-wrapper">
<div id="webview-container"></div>
......
......@@ -29,6 +29,7 @@ function OcsApiReducer(state,action){
}
case 'SET_DOWNLOAD_ITEM':{
const item = { ...action.item,status:'Downloading' }
console.log(item);
const downloadItems = [ ...state.downloadItems, item ]
return { ...state, downloadItems:downloadItems}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment