Skip to content

Commit

Permalink
resolve TypeScript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Dec 26, 2022
1 parent d961b84 commit 61d7d0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/DataDownloader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ onMounted(async () => {
// Make filename RFC5987 compatible
const escapedFileName = encodeURIComponent(fileName).replace(/['()]/g, escape).replace(/\*/g, '%2A');
const headers: [string, string][] = [
...( contentLengthStr === undefined ? [] : [ [ "Content-Length", contentLengthStr ] ] ),
...( contentLengthStr === undefined ? [] : [ [ "Content-Length", contentLengthStr ] ] satisfies [[string, string]] ),
// Without "Content-Type", Safari in iOS 15 adds ".html" to the downloading file
...( fileTypeResult === undefined ? [] : [ [ "Content-Type", fileTypeResult.mime ] ] ),
...( fileTypeResult === undefined ? [] : [ [ "Content-Type", fileTypeResult.mime ] ] satisfies [[string, string]] ),
['Content-Disposition', "attachment; filename*=UTF-8''" + escapedFileName],
];
// Enroll download ReadableStream and get sw-download ID
Expand Down
6 changes: 4 additions & 2 deletions src/components/DataViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,11 @@ onMounted(async () => {
// If error
if (keyExchangeRes.type === "error") {
switch (keyExchangeRes.error.code) {
case "key_exchange_error":
updateErrorMessage(() => strings.value?.["key_exchange_error"](keyExchangeRes.error.keyExchangeErrorCode));
case "key_exchange_error": {
const errorCode = keyExchangeRes.error.keyExchangeErrorCode;
updateErrorMessage(() => strings.value?.["key_exchange_error"](errorCode));
break;
}
case "sender_not_verified":
updateErrorMessage(() => strings.value?.["sender_not_verified"]);
break;
Expand Down

0 comments on commit 61d7d0f

Please sign in to comment.