Skip to content

Commit afdb63b

Browse files
committed
fix mobile importJs
1 parent b29c6f9 commit afdb63b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/api/API.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ export class API {
3838
* @param path the vault relative path of the file to import
3939
*/
4040
public async importJs(path: string): Promise<any> {
41-
const fullPath = this.app.vault.adapter.getResourcePath(path);
41+
let fullPath = this.app.vault.adapter.getResourcePath(path);
42+
if (!fullPath.includes('?')) {
43+
const scriptFile = this.app.metadataCache.getFirstLinkpathDest(path, "")
44+
if (scriptFile) {
45+
fullPath += '?' + scriptFile.stat.mtime
46+
}
47+
}
4248
return import(fullPath);
4349
}
4450

0 commit comments

Comments
 (0)