Compare commits

...

3 Commits
4.5 ... 2.1.4.1

Author SHA1 Message Date
Ajay Ramachandran
3ded2d0ced bump version 2021-08-05 17:04:33 -04:00
Ajay Ramachandran
314c793992 Don't break chat when no warning reason 2021-08-05 17:02:37 -04:00
Ajay Ramachandran
accc985e4b Don't display pipe in chatr name if not needed 2021-08-05 17:02:29 -04:00
2 changed files with 5 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
"version": "2.1.4",
"version": "2.1.4.1",
"default_locale": "en",
"description": "__MSG_Description__",
"content_scripts": [{

View File

@@ -34,11 +34,12 @@ export async function openWarningChat(warningMessage: string): Promise<void> {
const userNameData = await utils.asyncRequestToServer("GET", "/api/getUsername?userID=" + Config.config.userID);
const userName = userNameData.ok ? JSON.parse(userNameData.responseText).userName : "";
const publicUserID = await utils.getHash(Config.config.userID);
const warningReasonMatch = warningMessage.match(/Warning reason: '(.+)'/);
openChat({
displayName: `${userName ? `${userName} | `: ``}${userName !== publicUserID ? publicUserID : ``}`,
displayName: `${userName ? userName : ``}${userName !== publicUserID ? ` | ${publicUserID}` : ``}`,
composerInitialValue: `I got a warning and want to know what I need to do to improve.` +
`Warning reason: ${warningMessage.match(/Warning reason: '(.+)'/)[1]}`,
warningReasonMatch ? ` Warning reason: ${warningReasonMatch[1]}` : ``,
customDescription: chrome.i18n.getMessage("warningChatInfo")
});
}