MCPcopy
hub / github.com/iChochy/NCE / applyBookFromHash

Method applyBookFromHash

js/ReadingSystem.js:127–132  ·  view source on GitHub ↗

* 从 URL hash 应用课本 * @returns {Promise }

()

Source from the content-addressed store, hash-verified

125 * @returns {Promise<void>}
126 */
127 async applyBookFromHash() {
128 const keyFromHash = location.hash.slice(1).trim();
129 const storedBookKey = getStorage(this.config.STORAGE_KEYS.BOOK_SELECTION);
130 const initialBookKey = keyFromHash || storedBookKey || this.config.DEFAULT_BOOK_KEY;
131 await this.applyBookChange(initialBookKey);
132 }
133
134 /**
135 * 应用课本切换

Callers 1

initMethod · 0.95

Calls 2

applyBookChangeMethod · 0.95
getStorageFunction · 0.90

Tested by

no test coverage detected