feat: layout url import

feat: backup import (except chords)
feat: legacy layout import
feat: separate layout, chord & setting backup downloads
This commit is contained in:
2023-11-15 01:14:34 +01:00
parent acd58646f6
commit c5d9defc9d
20 changed files with 299 additions and 143 deletions

View File

@@ -24,7 +24,7 @@ export function decompressActions(raw: Uint8Array): number[] {
const actions: number[] = []
for (let i = 0; i < raw.length; i++) {
let action = raw[i]
if (action < 32) {
if (action > 0 && action < 32) {
action = (action << 8) | raw[++i]
}
actions.push(action)

View File

@@ -20,7 +20,7 @@ export async function toBase64(blob: Blob): Promise<string> {
})
}
export async function fromBase64(base64: string): Promise<Blob> {
export async function fromBase64(base64: string, fetch = window.fetch): Promise<Blob> {
return fetch(
`data:application/octet-stream;base64,${base64
.replaceAll(".", "+")