Skip to content

Commit e59d8e5

Browse files
committed
Fixed: Fix the problem of tab limit caused by the replication of the window
1 parent 9d76907 commit e59d8e5

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

src/app/elements/content/content.component.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,26 @@ export class ElementContentComponent implements OnInit, OnDestroy {
220220
{
221221
title: 'Clone Connect',
222222
icon: 'fa-copy',
223-
callback: () => {
223+
callback: async () => {
224224
const id = this.rIdx + 1;
225225
const oldId = this.viewIds[this.rIdx];
226226
const oldView = this.viewList.find(i => i.id === oldId);
227227
const oldConnectToken = oldView.connectToken;
228-
this._connectTokenSvc.exchange(oldConnectToken).then(newConnectToken => {
229-
const newView = new View(oldView.asset, oldView.connectData, newConnectToken);
230-
this._viewSvc.addView(newView);
231-
this.setViewActive(newView);
232-
});
228+
229+
if (this.viewList.length >= 15) {
230+
const msg = await this._i18nSvc.t('tabLimits');
231+
const ok = window.confirm(msg);
232+
233+
if (ok) {
234+
window.open(window.location.href, '_blank');
235+
}
236+
} else {
237+
this._connectTokenSvc.exchange(oldConnectToken).then(newConnectToken => {
238+
const newView = new View(oldView.asset, oldView.connectData, newConnectToken);
239+
this._viewSvc.addView(newView);
240+
this.setViewActive(newView);
241+
});
242+
}
233243
}
234244
},
235245
{

0 commit comments

Comments
 (0)