Skip to content

Commit

Permalink
Make action handler checks case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
threema-danilo committed May 8, 2017
1 parent 9dc22cd commit 11718cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/directives/threema_action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default [
};

const getThreemaActionHandler = (name: string) => {
switch (name) {
switch (name.toLowerCase()) {
case 'add':
return addAction;
case 'compose':
Expand All @@ -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]);
Expand Down

0 comments on commit 11718cb

Please sign in to comment.