Skip to content

Commit

Permalink
there were two create buttons, one was missed
Browse files Browse the repository at this point in the history
  • Loading branch information
deepansh96 committed Dec 3, 2024
1 parent f385bfd commit 599d888
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default {
this.$mixpanel.track("Visit Home");
},
computed: {
...mapState("auth", ["activeWorkspace", "userSettings"]),
...mapState("auth", ["activeWorkspace", "userSettings", "user"]),
...mapState("sync", ["pending"]),
...mapGetters("auth", [
"isPersonalWorkspace",
Expand All @@ -141,7 +141,7 @@ export default {
},
methods: {
...mapActions("sync", ["startLoading", "stopLoading"]),
...mapActions("auth", ["setActiveWorkspace"]),
...mapActions("auth", ["setActiveWorkspace", "unsetActiveWorkspace"]),
plioDeleted() {
// invoked when a plio is deleted
Expand Down Expand Up @@ -217,6 +217,16 @@ export default {
});
this.$mixpanel.people.increment("Total Plios Created");
let isUserInWorkspace = this.user.organizations.some((organization) => {
// no need to redirect if the user belongs to the workspace
// or the user is in the personal workspace
return (
organization.shortcode == this.activeWorkspace || this.activeWorkspace == ""
);
});
if (!isUserInWorkspace) this.unsetActiveWorkspace();
let createPlioResponse = await PlioAPIService.createPlio();
this.$Progress.finish();
if (createPlioResponse.status == 201) {
Expand Down

0 comments on commit 599d888

Please sign in to comment.