Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions chrome-extension/background/jobs/run-sync.tab.job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ export class RunSyncTabJob implements IJob {
this.notify('Sync has been canceled', `${adMobAccount.email} sync has been canceled.`);
} else {
this.notify(
'Sync has finished',
`Appodeal's ${currentUser.email} and Admob ${adMobAccount.email} accounts are in sync.`
'<h4>Sync has finished!</h4>',
`<p>Appodeal's <b>${currentUser.email}</b> and Admob <b>${adMobAccount.email}</b> accounts are in sync.</p>`
);
}
break;
Expand Down
11 changes: 10 additions & 1 deletion chrome-extension/content-scripts/admob-content-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@ $(document).ready(function () {
pingIntervalId = setInterval(pingBackgroundScript, 500);
// @see legacy/js/modal.js
modal = new Modal();
modal.show(title, 'Start sync inventory');
modal.show(
title,
`<h4>Start sync inventory</h4>
<div style="display: flex; align-items: flex-start; justify-content: flex-start;">
<svg style="margin-right: 8px; margin-top: 6px" width="16px" height="16px" fill="#f25b0c" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M13.1784199,2.2788327 C13.6884947,2.53387012 14.102091,2.94746641 14.3571284,3.45754124 L21.7211673,18.185619 C22.37215,19.4875845 21.8444243,21.0707619 20.5424588,21.7217447 C20.1764813,21.9047334 19.7729254,22 19.3637502,22 L4.63567242,22 C3.18003074,22 2,20.8199693 2,19.3643276 C2,18.9551524 2.09526662,18.5515965 2.27825534,18.185619 L9.64229424,3.45754124 C10.293277,2.15557574 11.8764544,1.62784995 13.1784199,2.2788327 Z M11.2372377,4.47154211 L4.09002086,18.7659757 C4.03082055,18.8843764 4,19.0149343 4,19.1473102 C4,19.6182378 4.38176222,20 4.85268979,20 L19.1471234,20 C19.2794993,20 19.4100573,19.9691794 19.5284579,19.9099791 C19.9496683,19.6993739 20.1203976,19.1871862 19.9097924,18.7659757 L12.7625755,4.47154211 C12.6800661,4.30652327 12.5462599,4.17271706 12.3812411,4.09020764 C11.9600307,3.87960243 11.4478429,4.05033169 11.2372377,4.47154211 Z M12,16 C12.5522847,16 13,16.4477153 13,17 C13,17.5522847 12.5522847,18 12,18 C11.4477153,18 11,17.5522847 11,17 C11,16.4477153 11.4477153,16 12,16 Z M12,8 C12.5522847,8 13,8.44771525 13,9 L13,13 C13,13.5522847 12.5522847,14 12,14 C11.4477153,14 11,13.5522847 11,13 L11,9 C11,8.44771525 11.4477153,8 12,8 Z"/>
</svg>
<p>Don't close the window otherwise synchronization will be interrupted!</p>
</div>`
);
}

function onUpdateProgress (syncProgress) {
Expand Down
9 changes: 7 additions & 2 deletions chrome-extension/popup/utils/popupClickHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,20 @@ export async function onClickStartAdmobAccountSetup () {
setTimeout(() => {window.close();}, 200);
}


export async function startSyncAdmobAccount () {
export async function reloadPageAdMobAccount () {
const tabs = await chrome.tabs.query({active: true, currentWindow: true});
const tab = tabs[0];
if (tab.url && tab.url.startsWith(ADMOB_DASHBOARD_ROOT)) {
await chrome.tabs.update(tab.id, {url: ADMOB_HOME});
} else {
await chrome.tabs.update(tab.id, {url: ADMOB_HOME_WITH_RELOGIN});
}

return tab;
}

export async function startSyncAdmobAccount () {
let tab = await reloadPageAdMobAccount();
await setCurrentJob(TabJobs.syncAdunits, tab.id);
}

Expand Down
2 changes: 2 additions & 0 deletions src/core/sync-apps/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {SyncEventEmitter} from './sync-event.emitter';
import {SyncRunner} from './sync-runner';
import {SyncErrorEvent, SyncEvent, SyncEventsTypes, SyncReportProgressEvent, SyncStopEvent} from './sync.events';
import escapeStringRegexp = require('escape-string-regexp');
import {reloadPageAdMobAccount} from "../../../chrome-extension/popup/utils/popupClickHandlers";


const isObject = (v) => v !== null && typeof v === 'object';
Expand Down Expand Up @@ -161,6 +162,7 @@ export class Sync {
throw e;
} finally {
this.finish();
setTimeout(async () => await reloadPageAdMobAccount(), 2000);
}
}

Expand Down