mirror of
https://github.com/immich-app/immich.git
synced 2026-01-09 05:30:52 -05:00
fix: import config from json (#25030)
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
This commit is contained in:
parent
e700bb5467
commit
86e5c611ec
@ -96,7 +96,7 @@ export const handleDownloadConfig = (config: SystemConfigDto) => {
|
||||
export const handleUploadConfig = () => {
|
||||
const input = globalThis.document.createElement('input');
|
||||
input.setAttribute('type', 'file');
|
||||
input.setAttribute('accept', 'json');
|
||||
input.setAttribute('accept', '.json');
|
||||
input.setAttribute('style', 'display: none');
|
||||
|
||||
input.addEventListener('change', ({ target }) => {
|
||||
@ -109,8 +109,10 @@ export const handleUploadConfig = () => {
|
||||
const newConfig = JSON.parse(text);
|
||||
await handleSystemConfigSave(newConfig);
|
||||
};
|
||||
reader().catch((error) => console.error('Error handling JSON config upload', error));
|
||||
globalThis.document.append(input);
|
||||
reader()
|
||||
.catch((error) => console.error('Error handling JSON config upload', error))
|
||||
.finally(() => input.remove());
|
||||
});
|
||||
input.remove();
|
||||
globalThis.document.body.append(input);
|
||||
input.click();
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user