mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-08 22:45:49 +01:00
Use Config provider everywhere in app
We can now load as much data as we want in the services and settings values. This solves the issue of using multiple localStorages boxes
This commit is contained in:
@@ -2,12 +2,14 @@ import { Anchor, Button, ThemeIcon, Tooltip } from '@mantine/core';
|
||||
import fileDownload from 'js-file-download';
|
||||
import { Dropzone, DropzoneStatus, IMAGE_MIME_TYPE } from '@mantine/dropzone';
|
||||
import { Download } from 'tabler-icons-react';
|
||||
import { useConfig } from '../../tools/state';
|
||||
|
||||
export default function SaveConfigComponent(props: any) {
|
||||
|
||||
const { config } = useConfig();
|
||||
function onClick(e: any) {
|
||||
const services = localStorage.getItem('services');
|
||||
if (services) {
|
||||
fileDownload(JSON.stringify(JSON.parse(services), null, '\t'), 'services.json');
|
||||
if (config) {
|
||||
fileDownload(JSON.stringify(config, null, '\t'), 'services.json');
|
||||
}
|
||||
}
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user