mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 23:24:35 +01:00
move image files to local bg folder
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user