Skip to content

Commit

Permalink
fix: fix reference link in editor while printing (#2050)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Nov 20, 2024
1 parent 9c54587 commit 423e2a1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/TheEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,14 @@ export default class TheEditor extends Mixins(BaseMixin) {
return this.$store.state.server.system_info?.available_services ?? []
}
get restartServiceName() {
get restartAllowedOrPossible() {
if (!this.isWriteable) return null
if (['printing', 'paused'].includes(this.printer_state)) return null
return true
}
get restartServiceName() {
// check for generic services <service>.conf (like moonraker.conf, crowsnest.conf, sonar.conf)
if (this.availableServices.includes(this.filenameWithoutExtension) && this.fileExtension === 'conf')
return this.filenameWithoutExtension
Expand All @@ -309,6 +313,8 @@ export default class TheEditor extends Mixins(BaseMixin) {
}
get restartServiceNameExists() {
if (!this.restartAllowedOrPossible) return false
// hide the button, if there is no service found
if (this.restartServiceName === null) return false
Expand Down

0 comments on commit 423e2a1

Please sign in to comment.