Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
814845e8
Commit
814845e8
authored
Aug 21, 2016
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide a nicer notification when reconnecting
after a dropped connection.
parent
b0de7948
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
src/converse-core.js
src/converse-core.js
+3
-2
src/converse-notification.js
src/converse-notification.js
+12
-4
No files found.
src/converse-core.js
View file @
814845e8
...
@@ -403,8 +403,9 @@
...
@@ -403,8 +403,9 @@
converse
.
connection
.
reconnecting
=
true
;
converse
.
connection
.
reconnecting
=
true
;
converse
.
connection
.
disconnect
(
'
re-connecting
'
);
converse
.
connection
.
disconnect
(
'
re-connecting
'
);
converse
.
connection
.
reset
();
converse
.
connection
.
reset
();
converse
.
log
(
'
Attempting to reconnect
'
);
converse
.
log
(
'
The connection has dropped, attempting to reconnect.
'
);
converse
.
giveFeedback
(
__
(
'
Attempting to reconnect
'
),
'
error
'
);
converse
.
giveFeedback
(
__
(
'
The connection has dropped, attempting to reconnect.
'
),
'
warn
'
);
converse
.
clearSession
();
converse
.
clearSession
();
converse
.
_tearDown
();
converse
.
_tearDown
();
if
(
converse
.
authentication
!==
"
prebind
"
)
{
if
(
converse
.
authentication
!==
"
prebind
"
)
{
...
...
src/converse-notification.js
View file @
814845e8
...
@@ -194,8 +194,16 @@
...
@@ -194,8 +194,16 @@
setTimeout
(
n
.
close
.
bind
(
n
),
5000
);
setTimeout
(
n
.
close
.
bind
(
n
),
5000
);
};
};
converse
.
showErrorNotification
=
function
(
data
)
{
converse
.
showFeedbackNotification
=
function
(
data
)
{
var
n
=
new
Notification
(
__
(
'
An error has occured
'
),
{
var
subject
;
if
(
data
.
klass
===
'
error
'
)
{
subject
=
__
(
'
An error has occured
'
);
}
else
if
(
data
.
klass
===
'
warn
'
)
{
subject
=
__
(
'
Please be aware
'
);
}
else
{
return
;
}
var
n
=
new
Notification
(
subject
,
{
body
:
data
.
message
,
body
:
data
.
message
,
lang
:
converse
.
i18n
.
locale_data
.
converse
[
""
].
lang
,
lang
:
converse
.
i18n
.
locale_data
.
converse
[
""
].
lang
,
icon
:
'
logo/conversejs.png
'
icon
:
'
logo/conversejs.png
'
...
@@ -234,8 +242,8 @@
...
@@ -234,8 +242,8 @@
};
};
converse
.
handleFeedback
=
function
(
evt
,
data
)
{
converse
.
handleFeedback
=
function
(
evt
,
data
)
{
if
(
data
.
klass
===
'
error
'
&&
converse
.
areDesktopNotificationsEnabled
(
true
))
{
if
(
converse
.
areDesktopNotificationsEnabled
(
true
))
{
converse
.
show
Error
Notification
(
data
);
converse
.
show
Feedback
Notification
(
data
);
}
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment