dialog
This commit is contained in:
parent
2aa978ca5b
commit
604a1b770c
3 changed files with 39 additions and 28 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { code2hash, evalScope, hash2code, logger } from '@strudel/core';
|
||||
import { code2hash, errorLogger, evalScope, hash2code, logger } from '@strudel/core';
|
||||
import { settingPatterns } from '../settings.mjs';
|
||||
import { setVersionDefaults } from '@strudel/webaudio';
|
||||
import { getMetadata } from '../metadata_parser';
|
||||
|
|
@ -107,7 +107,19 @@ export function confirmDialog(msg) {
|
|||
resolve(confirmed);
|
||||
});
|
||||
}
|
||||
|
||||
export const SETTING_CHANGE_RELOAD_MSG = 'Changing this setting requires the window to reload itself. OK?';
|
||||
export function confirmAndReloadPage(onSuccess) {
|
||||
confirmDialog(SETTING_CHANGE_RELOAD_MSG).then((r) => {
|
||||
if (r == true) {
|
||||
try {
|
||||
onSuccess();
|
||||
return window.location.reload();
|
||||
} catch (e) {
|
||||
errorLogger(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//RIP due to SPAM
|
||||
// let lastShared;
|
||||
// export async function shareCode(codeToShare) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue