mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-03-03 20:41:12 -08:00
feat: stop wiki before workspace remove
This commit is contained in:
parent
051e277dbc
commit
2dacc0b16e
2 changed files with 8 additions and 0 deletions
|
|
@ -15,3 +15,8 @@ module.exports.startWiki = function startWiki(homePath, userName, tiddlyWikiPort
|
|||
if (code !== 0) console.error(`[${homePath}] Worker stopped with exit code ${code}`);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.stopWiki = function stopWiki(homePath) {
|
||||
const worker = workers[homePath];
|
||||
return worker.terminate();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ const download = require('download');
|
|||
const tmp = require('tmp');
|
||||
|
||||
const sendToAllWindows = require('./send-to-all-windows');
|
||||
const { stopWiki } = require('./wiki/wiki-worker-mamager');
|
||||
|
||||
const v = '14';
|
||||
|
||||
|
|
@ -164,6 +165,8 @@ const removeWorkspacePicture = (id) => {
|
|||
};
|
||||
|
||||
const removeWorkspace = (id) => {
|
||||
const { name } = workspaces[id];
|
||||
stopWiki(name);
|
||||
delete workspaces[id];
|
||||
sendToAllWindows('set-workspace', id, null);
|
||||
settings.delete(`workspaces.${v}.${id}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue