File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -163,14 +163,14 @@ export default {
163163 },
164164 },
165165 created () {
166- this . session = createSession ( this . id )
166+ // Session is created in fetchData() after loadBoardById succeeds
167167 this .fetchData ()
168168 this .$root .$on (' open-card' , (cardId ) => {
169169 this .localModal = cardId
170170 })
171171 },
172172 beforeDestroy () {
173- this .session .close ()
173+ this .session ? .close ()
174174 },
175175 methods: {
176176 async fetchData () {
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export function isNotifyPushEnabled() {
7373 */
7474export function createSession ( boardId ) {
7575
76- if ( ! isNotifyPushEnabled ( ) ) {
76+ if ( ! boardId || ! isNotifyPushEnabled ( ) ) {
7777 // return a dummy object
7878 return {
7979 async close ( ) { } ,
@@ -107,7 +107,7 @@ export function createSession(boardId) {
107107 syncRunning = true
108108 await sessionApi . syncSession ( boardId , await tokenPromise )
109109 } catch ( err ) {
110- if ( err . response . status === 404 ) {
110+ if ( err . response ? .status === 404 ) {
111111 // session probably expired, let's
112112 // create a fresh session
113113 create ( )
You can’t perform that action at this time.
0 commit comments