Skip to content

Commit

Permalink
Integrate sword folder synchronization
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-klein committed Mar 2, 2024
1 parent 8bafccb commit 65916b3
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions app/frontend/controllers/db_sync_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,14 @@ module.exports.showDbSyncConfigDialog = async function() {
module.exports.startCustomModuleSync = async function() {
await initDbSync();

const $progressBar = $('#db-sync-progress-bar');
const customSwordModulePath = await ipcGeneral.getCustomSwordModulePath();

const $progressBar = $('#db-sync-progress-bar');
uiHelper.initProgressBar($progressBar);
$progressBar.show();

var dialogWidth = 800;
var dialogHeight = 600;
var dialogWidth = 600;
var dialogHeight = 400;
var draggable = true;
var position = [55, 120];

Expand All @@ -120,6 +121,22 @@ module.exports.startCustomModuleSync = async function() {

$('#db-sync-progress-box').dialog(customModuleSyncDialogOptions);
uiHelper.fixDialogCloseIconOnAndroid('db-sync-progress-dialog');

let adaptedDbSyncSwordFolderName = dbSyncSwordFolderName;

if (!adaptedDbSyncSwordFolderName.startsWith('/')) {
adaptedDbSyncSwordFolderName = '/' + adaptedDbSyncSwordFolderName;
}

let result = await ipcGeneral.syncDropboxFolderFromRemoteToLocal(
adaptedDbSyncSwordFolderName,
customSwordModulePath,
(progress) => {
$progressBar.progressbar("value", progress.percent);
}
);

console.log(`Finished synchronization of Dropbox folder. Result: ${result}`);
};

module.exports.showSyncResultMessage = async function() {
Expand Down

0 comments on commit 65916b3

Please sign in to comment.