Skip to content

Commit

Permalink
Route to postal when attached to a call
Browse files Browse the repository at this point in the history
  • Loading branch information
sl1ki0 authored Jun 16, 2024
1 parent 5438e5f commit c1d4b0f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions integrations/sync/client/flows/911-call-attach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,31 @@ onNet(
SetNuiFocus(true, true);
},
);

var POSTAL_COMMAND_DEFAULT = GetConvar("postal_command", "null");

Check failure on line 32 in integrations/sync/client/flows/911-call-attach.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected var, use let or const instead
onNet("sna-sync:attach-postal", (

Check failure on line 33 in integrations/sync/client/flows/911-call-attach.ts

View workflow job for this annotation

GitHub Actions / build

Replace `⏎··postal:·string⏎` with `postal:·string`
postal: string
) => {
const PostalCode = Number(postal);

if (POSTAL_COMMAND_DEFAULT === "null") {
console.error(`
---------------------------------------
[${GetCurrentResourceName()}] Failed to find the "postal_command" convar in your server.cfg. Please make sure you are using \`setr\` and not \`set\`:
\`setr postal_command "<your-command-here>" \`
---------------------------------------`);
};

Check failure on line 47 in integrations/sync/client/flows/911-call-attach.ts

View workflow job for this annotation

GitHub Actions / build

Delete `;`

if (PostalCode != null && PostalCode > 0){

Check failure on line 49 in integrations/sync/client/flows/911-call-attach.ts

View workflow job for this annotation

GitHub Actions / build

Unnecessary conditional, the types have no overlap

Check failure on line 49 in integrations/sync/client/flows/911-call-attach.ts

View workflow job for this annotation

GitHub Actions / build

Expected '!==' and instead saw '!='

Check failure on line 49 in integrations/sync/client/flows/911-call-attach.ts

View workflow job for this annotation

GitHub Actions / build

Insert `·`
ExecuteCommand(`${POSTAL_COMMAND_DEFAULT} ${PostalCode}`);
} else {
emit('chat:addMessage', {

Check failure on line 52 in integrations/sync/client/flows/911-call-attach.ts

View workflow job for this annotation

GitHub Actions / build

Replace `'chat:addMessage'` with `"chat:addMessage"`
color: [255, 0, 0],
multiline: true,
args: ['SnailyCAD', 'An error occured while making route to call postal']

Check failure on line 55 in integrations/sync/client/flows/911-call-attach.ts

View workflow job for this annotation

GitHub Actions / build

Replace `'SnailyCAD',·'An·error·occured·while·making·route·to·call·postal']` with `"SnailyCAD",·"An·error·occured·while·making·route·to·call·postal"],`
});
};

Check failure on line 57 in integrations/sync/client/flows/911-call-attach.ts

View workflow job for this annotation

GitHub Actions / build

Delete `;`
})

Check failure on line 58 in integrations/sync/client/flows/911-call-attach.ts

View workflow job for this annotation

GitHub Actions / build

Insert `;`

0 comments on commit c1d4b0f

Please sign in to comment.