From b87676d7b0307e44c099da9421b5f93e8e70a5b4 Mon Sep 17 00:00:00 2001 From: Leoh Date: Mon, 11 Oct 2021 12:40:42 +0530 Subject: [PATCH] Working settings sync --- .gitignore | 9 ++++++++- main.ts | 2 +- view.tsx | 5 +++-- view/App.tsx | 1 - 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index e6fab1b..d1ae52b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,11 @@ main.js data.json #vscode -.vscode \ No newline at end of file +.vscode + +#buildfiles +settings.js +view/App.js +ReactView.js +settings.js +view.js \ No newline at end of file diff --git a/main.ts b/main.ts index 41dd419..16aa5b7 100644 --- a/main.ts +++ b/main.ts @@ -21,7 +21,7 @@ export default class ExamplePlugin extends Plugin { this.addSettingTab(new ExampleSettingsTab(this.app, this)); this.registerView( VIEW_TYPE_EXAMPLE, - (leaf) => (this.view = new ExampleView(leaf)) + (leaf) => (this.view = new ExampleView(leaf, this)) ); this.addRibbonIcon("dice", "Activate view", () => { //activate view this.activateView(); diff --git a/view.tsx b/view.tsx index fd9ae59..5f69b9b 100644 --- a/view.tsx +++ b/view.tsx @@ -9,9 +9,10 @@ export const VIEW_TYPE_EXAMPLE = "example-view" export class ExampleView extends ItemView { plugin: ExamplePlugin; - constructor(leaf: WorkspaceLeaf) { + constructor(leaf: WorkspaceLeaf, plugin: ExamplePlugin) { super(leaf) - console.log(this.plugin.settings) } + this.plugin = plugin + } getViewType() { return VIEW_TYPE_EXAMPLE diff --git a/view/App.tsx b/view/App.tsx index 0bf80f9..9bf1f4d 100644 --- a/view/App.tsx +++ b/view/App.tsx @@ -20,7 +20,6 @@ class App extends React.Component { .then(res => res.json()) .then( result => { - console.log(result.data) this.setState({ isLoaded: true, tasks: result.data