Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
485212a1
Commit
485212a1
authored
3 years ago
by
崔佳豪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 切换站点重新加载订阅消息铃铛
parent
bb2b5beb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
NoticeIconView.js
src/components/GlobalHeader/NoticeIconView.js
+23
-0
Site.js
src/layouts/Site.js
+4
-1
No files found.
src/components/GlobalHeader/NoticeIconView.js
View file @
485212a1
...
...
@@ -36,6 +36,10 @@ class NoticeIconView extends Component {
videoMessage
:
{},
};
// this.renderPlatform
try
{
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
removeAllListeners
(
'reloadNotice'
);
}
catch
(
error
)
{
}
this
.
notifier
=
new
Notifier
(
this
.
props
.
global
.
userInfo
,
this
.
renderVideo
,
...
...
@@ -48,6 +52,24 @@ class NoticeIconView extends Component {
async
componentDidMount
()
{
this
.
notifier
.
subscribe
(
NEW_MESSAGE
,
this
.
onNewMessage
.
bind
(
this
));
this
.
notifier
.
start
();
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
on
(
'reloadNotice'
,
()
=>
{
try
{
// eslint-disable-next-line no-unused-expressions
this
.
notifier
&&
this
.
notifier
.
stop
();
}
catch
(
error
)
{
// eslint-disable-next-line no-empty
}
finally
{
this
.
notifier
=
new
Notifier
(
this
.
props
.
global
.
userInfo
,
this
.
renderVideo
,
this
.
renderPlatform
,
this
.
renderSysPlatform
,
this
.
props
,
);
this
.
notifier
.
subscribe
(
NEW_MESSAGE
,
this
.
onNewMessage
.
bind
(
this
));
this
.
notifier
.
start
();
}
});
}
componentWillUnmount
()
{
...
...
@@ -57,6 +79,7 @@ class NoticeIconView extends Component {
}
catch
(
error
)
{
// eslint-disable-next-line no-empty
}
finally
{
window
.
share
.
event
.
removeAllListeners
(
'reloadNotice'
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/layouts/Site.js
View file @
485212a1
...
...
@@ -350,13 +350,16 @@ class Site {
?
self
.
globalConfig
.
homepage
.
startsWith
(
homeType
)
?
self
.
globalConfig
.
homepage
:
`/
${
homeType
}
/
${
self
.
globalConfig
.
homepage
}
`
:
`/
homeType
`
;
:
`/
${
homeType
}
`
;
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
emit
(
'event:favitor'
,
{
name
:
"首页"
,
path
:
homePath
,
icon
:
null
,
});
// 重新加载订阅消息铃铛
window
.
share
&&
window
.
share
.
event
&&
window
.
share
.
event
.
emit
(
'reloadNotice'
);
// window.history.replaceState(
// '',
...
...
This diff is collapsed.
Click to expand it.
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