move image files to local bg folder

This commit is contained in:
SpikeHD
2022-06-01 18:08:50 -07:00
parent da6d05c7d0
commit 53f42be967
4 changed files with 45 additions and 12 deletions

View File

@@ -6,6 +6,7 @@ import './Options.css'
import { setConfigOption, getConfig, getConfigOption } from '../../../utils/configuration'
import Checkbox from '../common/Checkbox'
import Divider from './Divider'
import { invoke } from '@tauri-apps/api'
interface IProps {
closeFn: () => void;
@@ -80,8 +81,14 @@ export default class Options extends React.Component<IProps, IState> {
})
}
setCustomBackground(value: string) {
async setCustomBackground(value: string) {
setConfigOption('customBackground', value)
// Copy the file over to the local directory
invoke('copy_file', {
path: value.replace(/\\/g, '/'),
newPath: await invoke('get_local_bg_path')
})
}
render() {