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:
@ -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);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user