Skip to content

Commit

Permalink
re-add mobile check
Browse files Browse the repository at this point in the history
  • Loading branch information
shabegom committed Aug 23, 2021
1 parent 16c4c44 commit 381af9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default class MobileLogging extends Plugin {

// Call this method inside your plugin's `onLoad` function
async function monkeyPatchConsole(plugin: Plugin) {

if (!plugin.app.isMobile) return
const logs: string[] = [];
const logMessages = (prefix: string) => async (...messages: unknown[]) => {
const logTFile = plugin.app.vault.getAbstractFileByPath('Log.md') as TFile;
Expand All @@ -45,6 +45,7 @@ async function monkeyPatchConsole(plugin: Plugin) {
for (const message of messages) {
logs.push(String(message));
}

const newLogFileContent = `\n ${moment().format("HH:mm")} ${logs.join(" ")}`
await plugin.app.vault.modify(logTFile, newLogFileContent)
};
Expand Down

0 comments on commit 381af9d

Please sign in to comment.