feat: add more categories to explore page

This commit is contained in:
qier222 2020-11-02 12:32:22 +08:00
parent f17d61c268
commit 2e0b18d217
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
8 changed files with 546 additions and 4502 deletions

View file

@ -1,4 +1,12 @@
import pack from "../../package.json";
import initLocalStorage from "@/store/initLocalStorage.js";
// function exampleFunction() {
// console.log("update to vx.x.x");
// // 0.2.0 to 0.2.1
// localStorage.setItem("appVersion", "x.x.x");
// window.location.reload();
// }
function updateTo_0_2_0() {
// 0.1 to 0.2.0
@ -18,11 +26,25 @@ function updateTo_0_2_0() {
window.location.reload();
}
function updateTo_0_2_1() {
console.log("update to v0.2.1");
// 0.2.0 to 0.2.1
// 初始化 playlistCategories
let settings = JSON.parse(localStorage.getItem("settings"));
settings.playlistCategories = initLocalStorage.settings.playlistCategories;
localStorage.setItem("settings", JSON.stringify(settings));
localStorage.setItem("appVersion", "0.2.1");
window.location.reload();
}
export default function () {
while (localStorage.getItem("appVersion") !== pack.version) {
let currentVersion = localStorage.getItem("appVersion");
if (currentVersion === "0.1") {
updateTo_0_2_0();
}
if (currentVersion === "0.2.0") {
updateTo_0_2_1();
}
}
}