mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-26 00:16:51 +00:00
Refactor projects to use indexeddb
This commit is contained in:
@@ -52,8 +52,13 @@ export class MixedFileSystem implements core.ExternalFileSystem {
|
||||
}
|
||||
|
||||
async setOverlay(prefix: string, fs: core.ExternalFileSystem) {
|
||||
this.overlays.push({ prefix, fs })
|
||||
this.overlays.sort((a, b) => b.prefix.length - a.prefix.length)
|
||||
const index = this.overlays.findIndex(overlay => overlay.prefix === prefix)
|
||||
if (index !== -1) {
|
||||
this.overlays.splice(index, 1, { prefix, fs })
|
||||
} else {
|
||||
this.overlays.push({ prefix, fs })
|
||||
this.overlays.sort((a, b) => b.prefix.length - a.prefix.length)
|
||||
}
|
||||
if (this.watcher) {
|
||||
await this.watcher.withOverlay(prefix, fs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user