mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
feat(settings): add button to restart application
This commit is contained in:
parent
3605a77b25
commit
1e985f7858
@ -20,8 +20,10 @@ const TPL = `
|
|||||||
<input type="checkbox" class="background-effects form-check-input" />
|
<input type="checkbox" class="background-effects form-check-input" />
|
||||||
<strong>Enable background effects (Windows 11 only)</strong>
|
<strong>Enable background effects (Windows 11 only)</strong>
|
||||||
<p>On the desktop application, it's possible to use a semi-transparent background tinted in the colors of the user's wallpaper to add a touch of color.</p>
|
<p>On the desktop application, it's possible to use a semi-transparent background tinted in the colors of the user's wallpaper to add a touch of color.</p>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<button class="btn btn-micro restart-app-button">Restart the application to view the changes</button>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@ -36,9 +38,13 @@ export default class ElectronIntegrationOptions extends OptionsWidget {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.$backgroundEffects = this.$widget.find("input.background-effects");
|
this.$backgroundEffects = this.$widget.find("input.background-effects");
|
||||||
this.$backgroundEffects.on("change", async () => {
|
this.$backgroundEffects.on("change", () => this.updateCheckboxOption("backgroundEffects", this.$backgroundEffects));
|
||||||
await this.updateCheckboxOption("backgroundEffects", this.$backgroundEffects);
|
|
||||||
utils.reloadFrontendApp("background effect change");
|
const restartAppButton = this.$widget.find(".restart-app-button");
|
||||||
|
restartAppButton.on("click", () => {
|
||||||
|
const app = utils.dynamicRequire('@electron/remote').app;
|
||||||
|
app.relaunch();
|
||||||
|
app.exit();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user