Skip to content

Commit

Permalink
modifying textStore to just hold one string at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
assuntad23 committed Sep 14, 2023
1 parent 4644114 commit 28ada02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
5 changes: 0 additions & 5 deletions client/src/components/Panels/HelpModeText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ const helpText = computed({
<template>
<div class="unified-panel-body d-flex justify-content-between">
<div class="helpModeContainer">
<!-- for each item in useHelpModeTextStore, display them -->
<!-- <div v-for="item in helpText" :key="item.id" class="helpModeText">
<a class="helpModeText-link" :href="item.href">{{ item }}</a>
</div> -->
HELP TEXT DISPLAYED HERE <br />
{{ helpText }}
</div>
</div>
Expand Down
20 changes: 11 additions & 9 deletions client/src/stores/helpmode/helpModeTextStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@ import { defineStore } from "pinia";
export const useHelpModeTextStore = defineStore("helpModeTextStore", {
state: () => {
return {
helpmodetext: "I'm a help mode item",
helpmodetext: "",
};
},

actions: {
addHelpModeText(text) {
//only push up to 20 items, then start removing the oldest items
if (!this.helpmodetext.includes(text)) {
if (this.helpmodetext.length < 20) {
this.helpmodetext.push(text);
} else {
this.helpmodetext.shift();
this.helpmodetext.push(text);
}
}
//do we need to keep track of more than one item? or is this an enhancement?
// if (!this.helpmodetext.includes(text)) {
// if (this.helpmodetext.length < 20) {
// this.helpmodetext.push(text);
// } else {
// this.helpmodetext.shift();
// this.helpmodetext.push(text);
// }
// }
this.helpmodetext = text;
},
},
});

0 comments on commit 28ada02

Please sign in to comment.