aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views/SettingsView.vue
diff options
context:
space:
mode:
authorRémy Raes <contact@remyraes.com>2022-11-30 18:48:45 +0100
committerGitHub <noreply@github.com>2022-11-30 18:48:45 +0100
commitd61f3fe1b0c9f4461d33f289b3100465d77999ad (patch)
tree80d03616cc2475a242ce315f7007d4152cfd3bfe /src-vue/src/views/SettingsView.vue
parente301086cbb26fcb1d9e520c016b00233aba0f315 (diff)
downloadFlightCore-d61f3fe1b0c9f4461d33f289b3100465d77999ad.tar.gz
FlightCore-d61f3fe1b0c9f4461d33f289b3100465d77999ad.zip
feat: Release channel selector (#86)
* refactor: Move release channel button to settings * chore: Revert single newline removal * feat: add basic selector * feat: add basic selector style (to match button style) * fix: remove box-shadow on selector * feat: selector displays release canal from UI store * refactor: export toggleReleaseCandidate to store, for it to be used by release canal selector * feat: selector effectively changes release canal * fix: selector members typing issue * refactor: adjust selector labels * refactor: remove channel switching button Since the channel selector on the play view allows users to switch channels, this button is now useless. * feat: add a switch to toggle releases switching * feat: switch only appears if corresponding flag is enabled * feat: adjust button corners regarding releases switching state * feat: switch value is saved in persistent store * refactor: update release candidate label * fix: set release canal to RELEASE when switch is toggled off
Diffstat (limited to 'src-vue/src/views/SettingsView.vue')
-rw-r--r--src-vue/src/views/SettingsView.vue28
1 files changed, 28 insertions, 0 deletions
diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue
index 8cb6e810..ff87c394 100644
--- a/src-vue/src/views/SettingsView.vue
+++ b/src-vue/src/views/SettingsView.vue
@@ -21,6 +21,12 @@
<br />
<br />
UI design inspired by <el-link :underline="false" target="_blank" href="https://github.com/TFORevive/tforevive_launcher/" type="primary">TFORevive Launcher</el-link> (not yet public)
+
+ <h3>Testing:</h3>
+ <span>
+ Enable testing release channels
+ <el-switch v-model="enableReleasesSwitch"></el-switch>
+ </span>
</div>
</el-scrollbar>
</div>
@@ -29,6 +35,9 @@
<script lang="ts">
import { defineComponent } from "vue";
import { ElNotification } from 'element-plus';
+import { ReleaseCanal } from "../utils/ReleaseCanal";
+import { Store } from 'tauri-plugin-store-api';
+const persistentStore = new Store('flight-core-settings.json');
export default defineComponent({
name: "SettingsView",
@@ -41,6 +50,21 @@ export default defineComponent({
flightcoreVersion(): string {
return this.$store.state.flightcore_version;
},
+ enableReleasesSwitch: {
+ get(): boolean {
+ return this.$store.state.enableReleasesSwitch;
+ },
+ set(value: boolean): void {
+ this.$store.state.enableReleasesSwitch = value;
+ persistentStore.set('northstar-releases-switching', { value });
+
+ // When disabling switch, we switch release canal to stable release, to avoid users being
+ // stuck with release candidate after disabling release switching.
+ if (!value && this.$store.state.northstar_release_canal !== ReleaseCanal.RELEASE) {
+ this.$store.commit('toggleReleaseCandidate');
+ }
+ }
+ }
},
methods: {
activateDeveloperMode() {
@@ -82,4 +106,8 @@ h3:first-of-type {
.el-input {
width: 50%;
}
+
+.el-switch {
+ margin-left: 50px;
+}
</style>