bug fixes

This commit is contained in:
zadam 2020-08-27 22:03:56 +02:00
parent 445902d081
commit ef996f3919
7 changed files with 34 additions and 16 deletions

View File

@ -110,7 +110,7 @@ export default class DesktopMainWindowLayout {
.id('root-widget')
.css('height', '100vh')
.child(new FlexContainer('row').overflowing()
.css('height', '35px')
.css('height', '36px')
.child(new GlobalMenuWidget())
.child(new TabRowWidget())
.child(new TitleBarButtonsWidget()))

View File

@ -1,5 +1,5 @@
function reloadApp() {
//window.location.reload(true);
window.location.reload(true);
}
function parseDate(str) {

View File

@ -133,9 +133,14 @@ async function checkOutstandingSyncs() {
const { stats, initialized } = await $.get('api/sync/stats');
if (initialized) {
const remote = utils.dynamicRequire('electron').remote;
remote.app.relaunch();
remote.app.exit(0);
if (utils.isElectron()) {
const remote = utils.dynamicRequire('electron').remote;
remote.app.relaunch();
remote.app.exit(0);
}
else {
utils.reloadApp();
}
}
else {
const totalOutstandingSyncs = stats.outstandingPushes + stats.outstandingPulls;
@ -155,4 +160,4 @@ function hideAlert() {
ko.applyBindings(new SetupModel(), document.getElementById('setup-dialog'));
$("#setup-dialog").show();
$("#setup-dialog").show();

View File

@ -7,12 +7,18 @@ const TPL = `
<style>
.global-menu-wrapper {
height: 35px;
box-sizing: border-box;
border-bottom: 1px solid var(--main-border-color);
}
.global-menu {
height: 34px;
box-sizing: border-box;
}
.global-menu button {
margin-right: 10px;
height: 33px;
height: 34px;
border: none;
}

View File

@ -44,23 +44,25 @@ const TAB_ROW_TPL = `
.note-tab-row {
box-sizing: border-box;
position: relative;
height: 34px;
min-height: 34px;
height: 36px;
width: 100%;
background: var(--main-background-color);
border-radius: 5px 5px 0 0;
overflow: hidden;
margin-top: 2px;
}
.note-tab-row * {
box-sizing: inherit;
font: inherit;
}
.note-tab-row .note-tab-row-container {
box-sizing: border-box;
position: relative;
width: 100%;
height: 100%;
}
.note-tab-row .note-tab {
position: absolute;
left: 0;
@ -84,6 +86,7 @@ const TAB_ROW_TPL = `
font-size: 24px;
cursor: pointer;
border-bottom: 1px solid var(--main-border-color);
box-sizing: border-box;
}
.note-new-tab:hover {
@ -92,14 +95,14 @@ const TAB_ROW_TPL = `
}
.tab-row-filler {
box-sizing: border-box;
-webkit-app-region: drag;
position: absolute;
left: 0;
height: 33px;
height: 36px;
}
.tab-row-filler .tab-row-border {
position: relative;
background: linear-gradient(to right, var(--main-border-color), transparent);
height: 1px;
margin-top: 32px;

View File

@ -41,10 +41,14 @@ function getStats() {
return {};
}
return {
const stats = {
initialized: optionService.getOption('initialized') === 'true',
stats: syncService.stats
};
log.info(`Returning sync stats: ${JSON.stringify(stats)}`);
return stats;
}
function checkSync() {
@ -118,7 +122,7 @@ function forceNoteSync(req) {
function getChanged(req) {
const startTime = Date.now();
const lastEntityChangeId = parseInt(req.query.lastEntityChangedId);
const lastEntityChangeId = parseInt(req.query.lastEntityChangeId);
const entityChanges = sql.getRows("SELECT * FROM entity_changes WHERE isSynced = 1 AND id > ? LIMIT 1000", [lastEntityChangeId]);

View File

@ -355,8 +355,8 @@ function getLastSyncedPush() {
return parseInt(optionService.getOption('lastSyncedPush'));
}
function setLastSyncedPush(lastSyncedPush) {
optionService.setOption('lastSyncedPush', lastSyncedPush);
function setLastSyncedPush(entityChangeId) {
optionService.setOption('lastSyncedPush', entityChangeId);
}
function updatePushStats() {