mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 22:20:55 +03:00
added survey dialog. closes #1307
This commit is contained in:
@@ -2,11 +2,12 @@ import FileSender from './fileSender';
|
||||
import FileReceiver from './fileReceiver';
|
||||
import { copyToClipboard, delay, openLinksInNewTab, percent } from './utils';
|
||||
import * as metrics from './metrics';
|
||||
import { bytes } from './utils';
|
||||
import { bytes, locale } from './utils';
|
||||
import okDialog from './ui/okDialog';
|
||||
import copyDialog from './ui/copyDialog';
|
||||
import shareDialog from './ui/shareDialog';
|
||||
import signupDialog from './ui/signupDialog';
|
||||
import surveyDialog from './ui/surveyDialog';
|
||||
|
||||
export default function(state, emitter) {
|
||||
let lastRender = 0;
|
||||
@@ -281,6 +282,22 @@ export default function(state, emitter) {
|
||||
// metrics.copiedLink({ location });
|
||||
});
|
||||
|
||||
emitter.on('closeModal', () => {
|
||||
if (
|
||||
state.PREFS.surveyUrl &&
|
||||
['copy', 'share'].includes(state.modal.type) &&
|
||||
locale().startsWith('en') &&
|
||||
(state.storage.totalUploads > 1 || state.storage.totalDownloads > 0) &&
|
||||
!state.user.surveyed
|
||||
) {
|
||||
state.user.surveyed = true;
|
||||
state.modal = surveyDialog();
|
||||
} else {
|
||||
state.modal = null;
|
||||
}
|
||||
render();
|
||||
});
|
||||
|
||||
setInterval(() => {
|
||||
// poll for updates of the upload list
|
||||
if (!state.modal && state.route === '/') {
|
||||
|
||||
Reference in New Issue
Block a user