mirror of
https://github.com/silvanocerza/github-gitless-sync.git
synced 2026-07-22 12:10:28 +00:00
Add onboarding dialog when plugin is enabled
This commit is contained in:
parent
122185acac
commit
7d75daa1cc
1 changed files with 8 additions and 12 deletions
20
src/main.ts
20
src/main.ts
|
|
@ -3,6 +3,7 @@ import { GitHubSyncSettings, DEFAULT_SETTINGS } from "./settings/settings";
|
||||||
import GitHubSyncSettingsTab from "./settings/tab";
|
import GitHubSyncSettingsTab from "./settings/tab";
|
||||||
import SyncManager from "./sync-manager";
|
import SyncManager from "./sync-manager";
|
||||||
import { FileMetadata } from "./metadata-store";
|
import { FileMetadata } from "./metadata-store";
|
||||||
|
import { OnboardingDialog } from "./views/onboarding/view";
|
||||||
|
|
||||||
export default class GitHubSyncPlugin extends Plugin {
|
export default class GitHubSyncPlugin extends Plugin {
|
||||||
settings: GitHubSyncSettings;
|
settings: GitHubSyncSettings;
|
||||||
|
|
@ -16,8 +17,13 @@ export default class GitHubSyncPlugin extends Plugin {
|
||||||
vaultModifyListener: EventRef | null = null;
|
vaultModifyListener: EventRef | null = null;
|
||||||
|
|
||||||
async onUserEnable() {
|
async onUserEnable() {
|
||||||
// TODO: Add onboarding
|
if (this.app.isMobile) {
|
||||||
console.log("Enabled!");
|
// TODO: Implement onboarding for mobile
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.settings.firstStart) {
|
||||||
|
new OnboardingDialog(this).open();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async onload() {
|
async onload() {
|
||||||
|
|
@ -36,14 +42,6 @@ export default class GitHubSyncPlugin extends Plugin {
|
||||||
this.restartSyncInterval();
|
this.restartSyncInterval();
|
||||||
}
|
}
|
||||||
|
|
||||||
// const res = await this.client.getRepoContent(
|
|
||||||
// this.settings.githubOwner,
|
|
||||||
// this.settings.githubRepo,
|
|
||||||
// this.settings.repoContentDir,
|
|
||||||
// this.settings.githubBranch,
|
|
||||||
// );
|
|
||||||
// console.log(res);
|
|
||||||
|
|
||||||
this.app.workspace.onLayoutReady(async () => {
|
this.app.workspace.onLayoutReady(async () => {
|
||||||
// Create the events handling only after tha layout is ready to avoid
|
// Create the events handling only after tha layout is ready to avoid
|
||||||
// getting spammed with create events.
|
// getting spammed with create events.
|
||||||
|
|
@ -75,9 +73,7 @@ export default class GitHubSyncPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
async onunload() {
|
async onunload() {
|
||||||
// TODO: Stop all the things here
|
|
||||||
this.stopSyncInterval();
|
this.stopSyncInterval();
|
||||||
console.log("GitHubSyncPlugin unloaded");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
showStatusBarItem() {
|
showStatusBarItem() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue