aboutsummaryrefslogtreecommitdiff
path: root/src-vue/src/views
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2022-10-05 01:46:09 +0200
committerGitHub <noreply@github.com>2022-10-05 01:46:09 +0200
commit936764d6b7e9ea3ce69cc59918c440fb775ad64e (patch)
tree72dfd6686b05f53813d867dc82be1c9051b1c7d1 /src-vue/src/views
parent999da9e577bb12615a8c899f26f40df0a7f346a6 (diff)
downloadFlightCore-936764d6b7e9ea3ce69cc59918c440fb775ad64e.tar.gz
FlightCore-936764d6b7e9ea3ce69cc59918c440fb775ad64e.zip
feat: Allow switching between release channels (#3)
* feat: Allow switching between release channels Right now it's a single toggle button. In the future it should be a dropdown menu * fix: Use proper way to perform a change in state * refactor: Call right function to update state * fix: Use proper message type * refactor: Use ternary operator for release channel selection
Diffstat (limited to 'src-vue/src/views')
-rw-r--r--src-vue/src/views/DeveloperView.vue24
1 files changed, 24 insertions, 0 deletions
diff --git a/src-vue/src/views/DeveloperView.vue b/src-vue/src/views/DeveloperView.vue
index 52dd29fd..ccf0e732 100644
--- a/src-vue/src/views/DeveloperView.vue
+++ b/src-vue/src/views/DeveloperView.vue
@@ -7,6 +7,10 @@
<el-button type="primary" @click="crashApplication">
Panic button
</el-button>
+
+ <el-button type="primary" @click="toggleReleaseCandidate">
+ Toggle Release Candidate
+ </el-button>
</div>
</template>
@@ -14,6 +18,7 @@
import {defineComponent} from "vue";
import { invoke } from "@tauri-apps/api";
import { ElNotification } from "element-plus";
+import { ReleaseCanal } from "../utils/ReleaseCanal";
export default defineComponent({
name: "DeveloperView",
@@ -29,6 +34,25 @@ export default defineComponent({
type: 'error',
position: 'bottom-right'
});
+ },
+ async toggleReleaseCandidate() {
+ // Flip between RELEASE and RELEASE_CANDIDATE
+ this.$store.state.release_canal = this.$store.state.release_canal === ReleaseCanal.RELEASE
+ ? ReleaseCanal.RELEASE_CANDIDATE
+ : ReleaseCanal.RELEASE;
+
+ // Update current state so that update check etc can be performed
+ this.$store.commit("checkNorthstarUpdates");
+
+ console.log(this.$store.state)
+
+ // Display notification to highlight change
+ ElNotification({
+ title: `${this.$store.state.release_canal}`,
+ message: `Switched release channel to: "${this.$store.state.release_canal}"`,
+ type: 'success',
+ position: 'bottom-right'
+ });
}
}
});