Parcourir la source

Make action handler checks case insensitive

Danilo Bargen il y a 8 ans
Parent
commit
11718cb1d0
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/directives/threema_action.ts

+ 2 - 2
src/directives/threema_action.ts

@@ -57,7 +57,7 @@ export default [
         };
 
         const getThreemaActionHandler = (name: string) => {
-            switch (name) {
+            switch (name.toLowerCase()) {
                 case 'add':
                     return addAction;
                 case 'compose':
@@ -80,7 +80,7 @@ export default [
                             && node.tagName.toLowerCase() === 'a') {
 
                             const link = (node as HTMLElement).innerText;
-                            if (link !== undefined && link.startsWith('threema://')) {
+                            if (link !== undefined && link.toLowerCase().startsWith('threema://')) {
                                 const matches = (/\bthreema:\/\/([a-z]+)\?([^\s]+)\b/gi).exec(link);
                                 if (matches !== null) {
                                     const handler = getThreemaActionHandler(matches[1]);