xmoj-script 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/Update.json +1678 -1668
  2. package/XMOJ.user.js +10 -1
  3. package/package.json +1 -1
package/XMOJ.user.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // ==UserScript==
2
2
  // @name XMOJ
3
- // @version 1.2.0
3
+ // @version 1.2.1
4
4
  // @description XMOJ增强脚本
5
5
  // @author @XMOJ-Script-dev, @langningchen and the community
6
6
  // @namespace https://github/langningchen
@@ -3277,6 +3277,15 @@ async function main() {
3277
3277
  GetDataButton.disabled = true;
3278
3278
  GetDataButton.innerText = "正在获取数据...";
3279
3279
  let PID = localStorage.getItem("UserScript-Solution-" + SearchParams.get("sid") + "-Problem");
3280
+ if (PID == null) {
3281
+ GetDataButton.innerText = "失败! 无法获取PID";
3282
+ GetDataButton.disabled = false;
3283
+ await new Promise((resolve) => {
3284
+ setTimeout(resolve, 800);
3285
+ });
3286
+ GetDataButton.innerText = "获取数据";
3287
+ return;
3288
+ }
3280
3289
  let Code = "";
3281
3290
  if (localStorage.getItem(`UserScript-Problem-${PID}-IOFilename`) !== null) {
3282
3291
  Code = `#define IOFile "${localStorage.getItem(`UserScript-Problem-${PID}-IOFilename`)}"\n`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xmoj-script",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "an improvement script for xmoj.tech",
5
5
  "main": "AddonScript.js",
6
6
  "scripts": {