Convert 'show' usage to Toast
This commit is contained in:
parent
642d1d8b3e
commit
3c38a57560
|
@ -6,7 +6,6 @@ import React from 'react';
|
|||
import ReactDOM from 'react-dom';
|
||||
import { defineMessages } from 'react-intl';
|
||||
|
||||
import snackbar from 'soapbox/actions/snackbar';
|
||||
import { setSwUpdating } from 'soapbox/actions/sw';
|
||||
import * as BuildConfig from 'soapbox/build-config';
|
||||
import { store } from 'soapbox/store';
|
||||
|
@ -16,6 +15,7 @@ import { default as Soapbox } from './containers/soapbox';
|
|||
import * as monitoring from './monitoring';
|
||||
import * as perf from './performance';
|
||||
import ready from './ready';
|
||||
import toast from './toast';
|
||||
|
||||
const messages = defineMessages({
|
||||
update: { id: 'sw.update', defaultMessage: 'Update' },
|
||||
|
@ -43,14 +43,14 @@ function main() {
|
|||
// https://github.com/NekR/offline-plugin/pull/201#issuecomment-285133572
|
||||
OfflinePluginRuntime.install({
|
||||
onUpdateReady: function() {
|
||||
store.dispatch(snackbar.show('info', messages.updateText, {
|
||||
toast.info(messages.updateText, {
|
||||
actionLabel: messages.update,
|
||||
action: () => {
|
||||
store.dispatch(setSwUpdating(true));
|
||||
OfflinePluginRuntime.applyUpdate();
|
||||
},
|
||||
dismissAfter: false,
|
||||
}));
|
||||
duration: Infinity,
|
||||
});
|
||||
},
|
||||
onUpdated: function() {
|
||||
window.location.reload();
|
||||
|
|
Loading…
Reference in New Issue