Skip to content

Commit

Permalink
feat(twitter): remove unused nui callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
itschip committed Nov 23, 2021
1 parent f8805b1 commit 2f11d43
Showing 1 changed file with 1 addition and 53 deletions.
54 changes: 1 addition & 53 deletions resources/client/cl_twitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,8 @@ RegisterNuiProxy(TwitterEvents.CREATE_TWEET);
RegisterNuiProxy(TwitterEvents.FETCH_TWEETS_FILTERED);
RegisterNuiProxy(TwitterEvents.TOGGLE_LIKE);
RegisterNuiProxy(TwitterEvents.REPORT);
/**
* Twitter retweets
*/
RegisterNuiCallbackType(TwitterEvents.RETWEET);
on(`__cfx_nui:${TwitterEvents.RETWEET}`, (tweetId: number, cb: Function) => {
emitNet(TwitterEvents.RETWEET, tweetId);
cb();
});
RegisterNuiProxy(TwitterEvents.RETWEET);
/**
*
* Twitter get or create profile
*/

RegisterNuiCallbackType(TwitterEvents.GET_OR_CREATE_PROFILE);
on(`__cfx_nui:${TwitterEvents.GET_OR_CREATE_PROFILE}`, () => {
emitNet(TwitterEvents.GET_OR_CREATE_PROFILE);
Expand Down Expand Up @@ -63,26 +52,6 @@ onNet(TwitterEvents.UPDATE_PROFILE_RESULT, (alert: IAlertProps) => {
emitNet(TwitterEvents.GET_OR_CREATE_PROFILE);
});

/**
* Twitter fetch tweets
*/

/*
onNet(TwitterEvents.FETCH_TWEETS_SUCCESS, (tweets: any) => {
sendTwitterMessage(TwitterEvents.FETCH_TWEETS, tweets);
});
onNet(TwitterEvents.FETCH_TWEETS_FAILURE, () => {
sendTwitterMessage(TwitterEvents.FETCH_TWEETS_FAILURE);
});
*/

//kept for now, will need to remove later ^^

/**
* Twitter fetch filtered tweets
*/

onNet(TwitterEvents.FETCH_TWEETS_FILTERED_SUCCESS, (tweets: any) => {
sendTwitterMessage(TwitterEvents.FETCH_TWEETS_FILTERED_SUCCESS, tweets);
});
Expand All @@ -91,15 +60,6 @@ onNet(TwitterEvents.FETCH_TWEETS_FILTERED_FAILURE, () => {
sendTwitterMessage(TwitterEvents.FETCH_TWEETS_FILTERED_FAILURE);
});

/**
* Twitter create tweet
*/
/*RegisterNuiCallbackType(TwitterEvents.CREATE_TWEET);
on(`__cfx_nui:${TwitterEvents.CREATE_TWEET}`, (data: string) => {
sendTwitterMessage(TwitterEvents.CREATE_TWEET_LOADING, true);
emitNet(TwitterEvents.CREATE_TWEET, data);
});*/

onNet(TwitterEvents.CREATE_TWEET_RESULT, (alert: IAlertProps) => {
sendTwitterMessage(TwitterEvents.CREATE_TWEET_RESULT, alert);
emitNet(TwitterEvents.FETCH_TWEETS);
Expand All @@ -113,18 +73,6 @@ onNet(TwitterEvents.CREATE_TWEET_BROADCAST, (tweet: any) => {
sendTwitterMessage(TwitterEvents.CREATE_TWEET_BROADCAST, tweet);
});

/**
* Twitter delete tweet
*/

/**
* Twitter likes
*/

onNet(TwitterEvents.RETWEET_EXISTS, (alert: IAlertProps) => {
sendTwitterMessage(TwitterEvents.RETWEET_EXISTS, alert);
});

onNet(TwitterEvents.REPORT_SUCCESS, () => {
emitNet(TwitterEvents.FETCH_TWEETS);
});

0 comments on commit 2f11d43

Please sign in to comment.