export async function actionGlobalPasteState(pinia: Pinia) {
if (checkClipboardAccess()) return
try {
- pinia.state.value = JSON.parse(await navigator.clipboard.readText())
+ Object.assign(
+ pinia.state.value,
+ JSON.parse(await navigator.clipboard.readText())
+ )
toastMessage('Global state pasted from clipboard.')
} catch (error) {
if (checkNotFocusedError(error)) return
export async function actionGlobalOpenStateFile(pinia: Pinia) {
try {
- const open = await getFileOpener()
+ const open = getFileOpener()
const result = await open()
if (!result) return
const { text, file } = result
- pinia.state.value = JSON.parse(text)
+ Object.assign(pinia.state.value, JSON.parse(text))
toastMessage(`Global state imported from "${file.name}".`)
} catch (error) {
toastMessage(