-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: File refresh icon for reloading the file (and partials). (#236)
Instead of needing to reload the entire page to check for changes it now reloads just the individual file and clears the partials. Also updates the states for amagaki and grow to have the `partialsOrGetPartials` style of accessing the partials to prevent the need for the UI to keep track of the initial load. part of #133
- Loading branch information
Showing
9 changed files
with
174 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
import {GenericPartialsField} from '../../generic/field/partials'; | ||
import {PartialData} from '../../../editor/api'; | ||
|
||
export class AmagakiPartialsField extends GenericPartialsField { | ||
initPartials() { | ||
this.partials = this.globalConfig.state.projectTypes.amagaki.partials; | ||
this.globalConfig.state.projectTypes.amagaki.addListener( | ||
'getPartials', | ||
partials => { | ||
this.partials = partials; | ||
this.items = null; | ||
this.render(); | ||
} | ||
); | ||
|
||
// Load the partials if not loaded. | ||
if (this.partials === undefined) { | ||
this.globalConfig.state.projectTypes.amagaki.getPartials(); | ||
} | ||
get partials(): Record<string, PartialData> | undefined | null { | ||
return this.globalConfig.state.projectTypes.amagaki.partialsOrGetPartials(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
import {GenericPartialsField} from '../../generic/field/partials'; | ||
import {PartialData} from '../../../editor/api'; | ||
|
||
export class GrowPartialsField extends GenericPartialsField { | ||
initPartials() { | ||
this.partials = this.globalConfig.state.projectTypes.grow.partials; | ||
this.globalConfig.state.projectTypes.grow.addListener( | ||
'getPartials', | ||
partials => { | ||
this.partials = partials; | ||
this.items = null; | ||
this.render(); | ||
} | ||
); | ||
|
||
// Load the partials if not loaded. | ||
if (this.partials === undefined) { | ||
this.globalConfig.state.projectTypes.grow.getPartials(); | ||
} | ||
get partials(): Record<string, PartialData> | undefined | null { | ||
return this.globalConfig.state.projectTypes.grow.partialsOrGetPartials(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters