1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-06-14 12:02:31 +03:00

Drawio: Started browser drawing backup store system

Adds just the part to store image data, and remove on successfull save.
Alters save events to properly throw upon error.
Adds IDB-Keyval library for local large-size store.
For #4421
This commit is contained in:
Dan Brown
2023-08-22 19:30:39 +01:00
parent cbcec189fd
commit a4fbde9185
7 changed files with 61 additions and 28 deletions

View File

@ -70,3 +70,14 @@ export function uniqueId() {
const S4 = () => (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
return (`${S4() + S4()}-${S4()}-${S4()}-${S4()}-${S4()}${S4()}${S4()}`);
}
/**
* Create a promise that resolves after the given time.
* @param {int} timeMs
* @returns {Promise}
*/
export function wait(timeMs) {
return new Promise(res => {
setTimeout(res, timeMs);
});
}