Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nextcloud mail - PostGuard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Laura Kolijn
Nextcloud mail - PostGuard
Commits
4a318db2
Unverified
Commit
4a318db2
authored
5 years ago
by
Christoph Wurst
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2636 from nextcloud/fix/message-404-handling
Fix message not found handling
parents
a7990044
24647624
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Message.vue
+40
-42
40 additions, 42 deletions
src/components/Message.vue
with
40 additions
and
42 deletions
src/components/Message.vue
+
40
−
42
View file @
4a318db2
...
@@ -135,7 +135,7 @@ export default {
...
@@ -135,7 +135,7 @@ export default {
this
.
fetchMessage
()
this
.
fetchMessage
()
},
},
methods
:
{
methods
:
{
fetchMessage
()
{
async
fetchMessage
()
{
this
.
loading
=
true
this
.
loading
=
true
this
.
message
=
undefined
this
.
message
=
undefined
this
.
errorMessage
=
''
this
.
errorMessage
=
''
...
@@ -145,51 +145,49 @@ export default {
...
@@ -145,51 +145,49 @@ export default {
const
messageUid
=
this
.
$route
.
params
.
messageUid
const
messageUid
=
this
.
$route
.
params
.
messageUid
this
.
$store
try
{
.
dispatch
(
'
fetchMessage
'
,
messageUid
)
const
message
=
await
this
.
$store
.
dispatch
(
'
fetchMessage
'
,
messageUid
)
.
then
(
message
=>
{
// TODO: add timeout so that message isn't flagged when only viewed
// TODO: add timeout so that message isn't flagged when only viewed
// for a few seconds
// for a few seconds
if
(
message
&&
message
.
uid
!==
this
.
$route
.
params
.
messageUid
)
{
if
(
message
.
uid
!==
this
.
$route
.
params
.
messageUid
)
{
Logger
.
debug
(
"
User navigated away, loaded message won't be shown nor flagged as seen
"
)
Logger
.
debug
(
"
User navigated away, loaded message won't be shown nor flagged as seen
"
)
return
return
}
}
this
.
message
=
message
if
(
this
.
message
===
undefined
)
{
Logger
.
info
(
'
message could not be found
'
,
{
messageUid
})
this
.
errorMessage
=
getRandomMessageErrorMessage
()
this
.
loading
=
false
return
}
const
account
=
this
.
$store
.
getters
.
getAccount
(
message
.
accountId
)
this
.
replyRecipient
=
buildReplyRecipients
(
message
,
{
label
:
account
.
name
,
email
:
account
.
emailAddress
,
})
this
.
replySubject
=
buildReplySubject
(
message
.
subject
)
this
.
loading
=
fals
e
this
.
message
=
messag
e
this
.
envelope
=
this
.
$store
.
getters
.
getEnvelope
(
message
.
accountId
,
message
.
folderId
,
message
.
id
)
if
(
this
.
message
===
undefined
)
{
if
(
!
this
.
envelope
.
flags
.
unseen
)
{
Logger
.
info
(
'
message could not be found
'
,
{
messageUid
})
// Already seen -> no change necessary
this
.
errorMessage
=
getRandomMessageErrorMessage
()
return
this
.
loading
=
false
}
return
}
return
this
.
$store
.
dispatch
(
'
toggleEnvelopeSeen
'
,
this
.
envelope
)
const
account
=
this
.
$store
.
getters
.
getAccount
(
message
.
accountId
)
})
this
.
replyRecipient
=
buildReplyRecipients
(
message
,
{
.
catch
(
error
=>
{
label
:
account
.
name
,
Logger
.
error
(
'
could not load message
'
,
{
messageUid
,
error
})
email
:
account
.
emailAddress
,
if
(
error
.
isError
)
{
this
.
errorMessage
=
t
(
'
mail
'
,
'
Could not load your message
'
)
this
.
error
=
error
this
.
loading
=
false
}
})
})
this
.
replySubject
=
buildReplySubject
(
message
.
subject
)
this
.
loading
=
false
this
.
envelope
=
this
.
$store
.
getters
.
getEnvelope
(
message
.
accountId
,
message
.
folderId
,
message
.
id
)
if
(
!
this
.
envelope
.
flags
.
unseen
)
{
// Already seen -> no change necessary
return
}
return
this
.
$store
.
dispatch
(
'
toggleEnvelopeSeen
'
,
this
.
envelope
)
}
catch
(
error
)
{
Logger
.
error
(
'
could not load message
'
,
{
messageUid
,
error
})
if
(
error
.
isError
)
{
this
.
errorMessage
=
t
(
'
mail
'
,
'
Could not load your message
'
)
this
.
error
=
error
this
.
loading
=
false
}
}
},
},
replyMessage
()
{
replyMessage
()
{
this
.
$router
.
push
({
this
.
$router
.
push
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment