Update storage version to 11 and add alert during upgrade
This commit is contained in:
@@ -198,7 +198,7 @@ export function App() {
|
||||
localStorage.setItem(STORAGE_NAME_SELECTED, `${selectedChatIndex}`);
|
||||
}, [selectedChatIndex]);
|
||||
|
||||
const db = openDB<ChatStore>(STORAGE_NAME, 10, {
|
||||
const db = openDB<ChatStore>(STORAGE_NAME, 11, {
|
||||
async upgrade(db, oldVersion, newVersion, transaction) {
|
||||
if (oldVersion < 1) {
|
||||
const store = db.createObjectStore(STORAGE_NAME, {
|
||||
@@ -226,7 +226,8 @@ export function App() {
|
||||
}
|
||||
}
|
||||
|
||||
if (oldVersion < 10) {
|
||||
if (oldVersion < 11) {
|
||||
alert("Start upgrading storage, just a sec... (Click OK to continue)");
|
||||
if (
|
||||
transaction
|
||||
.objectStore(STORAGE_NAME)
|
||||
|
||||
@@ -33,7 +33,12 @@ export default function Search(props: {
|
||||
>
|
||||
<div className="flex justify-between">
|
||||
<span className="m-1 p-1 font-bold">Search</span>
|
||||
<button className="m-1 p-1 bg-cyan-400 rounded">Close</button>
|
||||
<button
|
||||
className="m-1 p-1 bg-cyan-400 rounded"
|
||||
onClick={() => props.setShow(false)}
|
||||
>
|
||||
Close
|
||||
</button>
|
||||
</div>
|
||||
<hr />
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user