mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-02 22:17:39 +00:00
feat(global): major fixes...i dont even know that to call this commit so ill just say its global. Who even cares
This commit is contained in:
1 parent
f6395e4b8e
commit
104fda2c11
10 files changed
+22
-28
No files matched your search
@@ -62,10 +62,6 @@ function Phone() {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
Nui.send(PhoneEvents.UI_IS_READY);
|
||||
}, [Nui]);
|
||||
|
||||
useKeyboardService();
|
||||
usePhoneService();
|
||||
useSimcardService();
|
||||
|
||||
@@ -11,11 +11,11 @@ export const twitterState = {
|
||||
}),
|
||||
tweets: atom({
|
||||
key: 'tweets',
|
||||
default: null,
|
||||
default: [],
|
||||
}),
|
||||
filteredTweets: atom({
|
||||
key: 'filteredTweets',
|
||||
default: null,
|
||||
default: [],
|
||||
}),
|
||||
showCreateTweetModal: atom({
|
||||
key: 'showCreateTweetModal',
|
||||
|
||||
@@ -20,11 +20,9 @@ function fetchOnInitialize() {
|
||||
sendMessage('PHONE', PhoneEvents.SET_CONFIG, config);
|
||||
}
|
||||
|
||||
if (config.general.enableMultiChar) {
|
||||
onNet(PhoneEvents.ON_INIT, () => {
|
||||
fetchOnInitialize();
|
||||
});
|
||||
}
|
||||
onNet(PhoneEvents.ON_INIT, () => {
|
||||
fetchOnInitialize();
|
||||
});
|
||||
|
||||
RegisterKeyMapping('phone', 'Open Phone', 'keyboard', 'f1');
|
||||
|
||||
@@ -125,12 +123,6 @@ AddEventHandler('onResourceStop', function (resource: string) {
|
||||
}
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(PhoneEvents.UI_IS_READY);
|
||||
on(`__cfx_nui:${PhoneEvents.UI_IS_READY}`, (_data: any, cb: Function) => {
|
||||
fetchOnInitialize();
|
||||
cb();
|
||||
});
|
||||
|
||||
// DO NOT CHANGE THIS EITHER, PLEASE - CHIP
|
||||
// ^ AND WHAT ARE YOU GOING TO DO HUH? - KIDZ
|
||||
|
||||
|
||||
@@ -29,9 +29,11 @@ const displayHelperText = () => {
|
||||
EndTextCommandDisplayHelp(0, true, false, -1);
|
||||
};
|
||||
|
||||
|
||||
RegisterNuiCallbackType(PhotoEvents.TAKE_PHOTO);
|
||||
on(`__cfx_nui:${PhotoEvents.TAKE_PHOTO}`, async (data: any, cb: Function) => {
|
||||
cb();
|
||||
emit('npwd:disableControlActions', false);
|
||||
// Create Phone Prop
|
||||
let frontCam = false;
|
||||
CreateMobilePhone(1);
|
||||
@@ -46,7 +48,6 @@ on(`__cfx_nui:${PhotoEvents.TAKE_PHOTO}`, async (data: any, cb: Function) => {
|
||||
|
||||
while (inCameraMode) {
|
||||
await Delay(0);
|
||||
displayHelperText();
|
||||
if (IsControlJustPressed(1, 27)) {
|
||||
frontCam = !frontCam;
|
||||
CellFrontCamActivate(frontCam);
|
||||
@@ -55,12 +56,16 @@ on(`__cfx_nui:${PhotoEvents.TAKE_PHOTO}`, async (data: any, cb: Function) => {
|
||||
} else if (IsControlJustPressed(1, 177)) {
|
||||
handleCameraExit();
|
||||
break;
|
||||
}
|
||||
}
|
||||
displayHelperText();
|
||||
}
|
||||
ClearHelp(true);
|
||||
emit('npwd:disableControlActions', true);
|
||||
});
|
||||
|
||||
const handleTakePicture = async () => {
|
||||
// Wait a frame so we don't draw the display helper text
|
||||
await Delay(0);
|
||||
takePhoto();
|
||||
await Delay(200);
|
||||
DestroyMobilePhone();
|
||||
|
||||
@@ -60,8 +60,8 @@ class CallsService {
|
||||
transmitterSource: transmittingPlayer.source,
|
||||
receiver: receivingNumber,
|
||||
receiverSource: receivingPlayer.source,
|
||||
start: startCallTimeUnix,
|
||||
accepted: false,
|
||||
start: startCallTimeUnix.toString(),
|
||||
is_accepted: false,
|
||||
};
|
||||
|
||||
if (!receivingPlayer) {
|
||||
@@ -99,7 +99,7 @@ class CallsService {
|
||||
// We retrieve the call that was accepted from the current calls map
|
||||
const curCallAccepted = this.callMap.get(transmitterNumber);
|
||||
// We update its reference
|
||||
curCallAccepted.accepted = true;
|
||||
curCallAccepted.is_accepted = true;
|
||||
|
||||
const channelId = src;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { matchLogger } from './match.utils';
|
||||
import MatchDB, { _MatchDB } from './match.db';
|
||||
import { Like, MatchEvents, Profile } from '../../../typings/match';
|
||||
import { getOrCreateProfile } from '../sv_match';
|
||||
import PlayerService from '../players/player.service';
|
||||
|
||||
class _MatchService {
|
||||
|
||||
@@ -6,7 +6,7 @@ export class PlayerRepo {
|
||||
const query = `SELECT ${config.database.identifierColumn} FROM ${config.database.playerTable} WHERE phone_number = ?`;
|
||||
const [results] = await pool.query(query, [phoneNumber]);
|
||||
// Get identifier from results
|
||||
return (results as { identifier: string }[])[0].identifier || null;
|
||||
return (results as any[])[0][config.database.identifierColumn] || null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@ class _PlayerService {
|
||||
|
||||
playerLogger.info('NPWD Player Loaded!');
|
||||
playerLogger.debug(newPlayer);
|
||||
emitNet(PhoneEvents.ON_INIT, pSource);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,13 +34,15 @@ const formatTweets = (profileId: number) => (tweet: Tweet): Tweet => ({
|
||||
|
||||
export class _TwitterDB {
|
||||
/**
|
||||
* Retrieve the latest 100 tweets
|
||||
* Retrieve the latest 50 tweets
|
||||
* @param profileId - twitter profile id of the player
|
||||
*/
|
||||
async fetchAllTweets(profileId: number): Promise<Tweet[]> {
|
||||
const query = `
|
||||
SELECT ${SELECT_FIELDS}
|
||||
FROM npwd_twitter_tweets
|
||||
FROM (
|
||||
SELECT * FROM npwd_twitter_tweets ORDER BY id DESC LIMIT 50
|
||||
) npwd_twitter_tweets
|
||||
LEFT OUTER JOIN npwd_twitter_profiles
|
||||
ON npwd_twitter_tweets.identifier = npwd_twitter_profiles.identifier
|
||||
LEFT OUTER JOIN npwd_twitter_likes ON npwd_twitter_tweets.id = npwd_twitter_likes.tweet_id AND
|
||||
@@ -51,7 +53,6 @@ export class _TwitterDB {
|
||||
LEFT OUTER JOIN npwd_twitter_profiles AS retweets_profiles
|
||||
ON retweets.identifier = retweets_profiles.identifier
|
||||
WHERE npwd_twitter_tweets.visible = 1
|
||||
ORDER BY npwd_twitter_tweets.id DESC LIMIT 50
|
||||
`;
|
||||
const [results] = await pool.query(query, [profileId, profileId]);
|
||||
const tweets = <Tweet[]>results;
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ export interface CallHistoryItem {
|
||||
receiverSource?: number;
|
||||
start: string;
|
||||
end?: number;
|
||||
is_accepted: number;
|
||||
is_accepted: boolean;
|
||||
}
|
||||
|
||||
export enum CallRejectReasons {
|
||||
|
||||
Reference in new issue
Block a user