musescore-downloader

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 596f63f77ed1936f411bdd854dd6c4c66d674eef
parent 7e4b5e2c15b4c12793d0e2173c06d78eaaa2e8b9
Author: Xmader <xmader@outlook.com>
Date:   Sun,  1 Dec 2019 00:13:14 -0500

debug

Diffstat:
Mdist/main.js | 6++++--
Mrollup.config.js | 1-
Msrc/main.ts | 3+++
3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/dist/main.js b/dist/main.js @@ -15,8 +15,6 @@ (function () { 'use strict'; - if (!window.UGAPP || !window.UGAPP.store || !window.UGAPP.store.jmuse_settings) { return } - const getIndexPath = (id) => { const idStr = String(id); // 获取最后三位,倒序排列 @@ -43,6 +41,10 @@ const main = () => { // @ts-ignore + if (!window.UGAPP || !window.UGAPP.store || !window.UGAPP.store.jmuse_settings) { + return; + } + // @ts-ignore const scorePlayer = window.UGAPP.store.jmuse_settings.score_player; const { id, vid } = scorePlayer.json; const baseURL = scorePlayer.urls.image_path; diff --git a/rollup.config.js b/rollup.config.js @@ -16,7 +16,6 @@ export default { format: "iife", sourcemap: false, banner: getBannerText, - intro: "if (!window.UGAPP || !window.UGAPP.store || !window.UGAPP.store.jmuse_settings) { return }" }, plugins: [ typescript({ diff --git a/src/main.ts b/src/main.ts @@ -6,6 +6,9 @@ import { getIndexPath, waitForDocumentLoaded } from "./utils" const main = () => { // @ts-ignore + if (!window.UGAPP || !window.UGAPP.store || !window.UGAPP.store.jmuse_settings) { return } + + // @ts-ignore const scorePlayer: ScorePlayerData = window.UGAPP.store.jmuse_settings.score_player const { id, vid } = scorePlayer.json