Rename sqlite3's loadStorage to loadSQLite3Storage

This commit is contained in:
gen740
2023-11-17 17:23:58 +09:00
parent ba92bd26a4
commit 72b6742849
4 changed files with 15 additions and 6 deletions
@@ -6,7 +6,7 @@ import React, {
useRef,
useState,
} from "react"
import { loadStorage } from "../sqlite3"
import { loadSQLite3Storage } from "../sqlite3"
import { useSetRecoilState } from "recoil"
import { studiesState } from "../state"
import {
@@ -30,7 +30,7 @@ export const StorageLoader: FC = () => {
r.addEventListener("load", () => {
const arrayBuffer = r.result as ArrayBuffer | null
if (arrayBuffer !== null) {
loadStorage(arrayBuffer, setStudies)
loadSQLite3Storage(arrayBuffer, setStudies)
}
})
r.readAsArrayBuffer(file)
@@ -108,7 +108,7 @@ export const StorageLoader: FC = () => {
<Typography
sx={{ textAlign: "center", color: theme.palette.grey.A400 }}
>
Drag your SQLite3 file here or click to browse.
Drag your SQLite3/JournalStorage file here or click to browse.
</Typography>
</CardContent>
</CardActionArea>
+9
View File
@@ -0,0 +1,9 @@
import { SetterOrUpdater } from "recoil"
export const loadStorage = (
arrayBuffer: ArrayBuffer,
setter: SetterOrUpdater<Study[]>
): void => {
}
+1 -1
View File
@@ -10,7 +10,7 @@ type SQLite3DB = {
}): void
}
export const loadStorage = (
export const loadSQLite3Storage = (
arrayBuffer: ArrayBuffer,
setter: SetterOrUpdater<Study[]>
): void => {
+2 -2
View File
@@ -4,7 +4,7 @@ import "./index.css"
import { App } from "./components/App"
import { RecoilRoot, useSetRecoilState, SetterOrUpdater } from "recoil"
import { studiesState } from "./state"
import { loadStorage } from "./sqlite3"
import { loadSQLite3Storage } from "./sqlite3"
export const AppWrapper: FC = () => {
const setStudies = useSetRecoilState<Study[]>(studiesState)
@@ -35,7 +35,7 @@ export const AppWrapper: FC = () => {
bytes[i] = binaryString.charCodeAt(i)
}
arrayBuffer = bytes.buffer
loadStorage(arrayBuffer, onceSetStudies)
loadSQLite3Storage(arrayBuffer, onceSetStudies)
break
}
})