2024-05-23 09:42:14 +00:00
|
|
|
// SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2024-04-08 17:02:56 +00:00
|
|
|
import { __ } from 'i18n'
|
|
|
|
import BaseModal from 'plugins/modal/modal.js'
|
2024-07-11 15:53:50 +00:00
|
|
|
import { api } from '@converse/headless'
|
2024-04-08 17:02:56 +00:00
|
|
|
import { html } from 'lit'
|
|
|
|
import 'livechat-external-login-content.js'
|
|
|
|
|
|
|
|
class ExternalLoginModal extends BaseModal {
|
|
|
|
remotePeertubeError = ''
|
|
|
|
|
|
|
|
renderModal () {
|
|
|
|
return html`<converse-livechat-external-login-content></converse-livechat-external-login-content>`
|
|
|
|
}
|
|
|
|
|
|
|
|
getModalTitle () {
|
|
|
|
// eslint-disable-next-line no-undef
|
|
|
|
return __(LOC_login_using_external_account)
|
|
|
|
}
|
2024-04-17 10:09:25 +00:00
|
|
|
|
2024-08-05 13:54:03 +00:00
|
|
|
close () {
|
|
|
|
super.close()
|
2024-04-19 07:53:23 +00:00
|
|
|
// kill the externalAuthGetResult handler if still there
|
2024-04-17 10:09:25 +00:00
|
|
|
try {
|
2024-04-19 07:53:23 +00:00
|
|
|
if (window.externalAuthGetResult) { window.externalAuthGetResult() }
|
2024-04-17 10:09:25 +00:00
|
|
|
} catch (err) {
|
|
|
|
console.error(err)
|
|
|
|
}
|
|
|
|
}
|
2024-04-08 17:02:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
api.elements.define('converse-livechat-external-login', ExternalLoginModal)
|