Skip to content

Commit

Permalink
fix: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vimercati-samir committed May 16, 2022
1 parent e738bde commit 4e34e65
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions components/ui/Popups/ErrorNetwork/ErrorNetwork.less
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
font-size: 1.9rem;
color: @secondary-text;
margin-top: 2rem;
text-align: center;
}

.subtitle {
Expand Down
14 changes: 12 additions & 2 deletions components/ui/Popups/ErrorNetwork/ErrorNetwork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
<script>
import Vue from 'vue'
import { mapState } from 'vuex'
import { throttle } from 'lodash'
import { RefreshCwIcon } from 'satellite-lucide-icons'
import { Config } from '~/config'
/**
* @component Error
* @description Component that takes an error message to display including source and extra details.
Expand All @@ -17,18 +20,25 @@ export default Vue.extend({
components: {
RefreshCwIcon,
},
watch: {
$route(to, from) {
if (to !== from) {
this.closeNetworkErrorPopup()
}
},
},
methods: {
/**
* @method toggleNetworkErrorPopup
* @description
* @example
*/
closeNetworkErrorPopup() {
closeNetworkErrorPopup: throttle(function () {
this.$store.commit('ui/toggleErrorNetworkModal', {
state: false,
action: null,
})
},
}, Config.modal.errorNetworkActionThrottle),
/**
* @method tryAgain
* @description
Expand Down
3 changes: 3 additions & 0 deletions config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,7 @@ export const Config = {
android: 10836, // lowest android value, some phones can handle more
electron: 11180, // including for completeness sake
},
modal: {
errorNetworkActionThrottle: 1000,
},
}
6 changes: 6 additions & 0 deletions pages/auth/register/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,16 @@ export default Vue.extend({
},
watch: {
allPrerequisitesReady(nextValue) {
console.log(nextValue)
if (!nextValue) return
this.$router.replace('/chat/direct')
},
},
mounted() {
if (this.allPrerequisitesReady) {
this.$router.replace('/chat/direct')
}
},
methods: {
async confirm(userData: UserRegistrationData) {
try {
Expand Down

0 comments on commit 4e34e65

Please sign in to comment.