Skip to content

Commit

Permalink
Merge pull request #91 from bambu-group-03/feat/blocked_user
Browse files Browse the repository at this point in the history
feat: blocked users
  • Loading branch information
LuisParedes1 committed Nov 24, 2023
2 parents cf87198 + 58521e9 commit acc55e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/core/auth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ const _useAuth = create<AuthState>((set, get) => ({
const user: UserType = await response.json();
await setUser(user); // store user and user in phone storage
await setToken(token); // store token in phone storage

if (user.blocked) {
await removeToken();
console.error('TAS BLOQUEAO PA');
set({ status: 'signOut', token: null });
return;
}

const status = isUserComplete(user) ? 'signInComplete' : 'signIn';
set({ status, user, token }); // store token in phone memory ram
},
Expand Down
5 changes: 4 additions & 1 deletion src/screens/feed/compose.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export const Compose = ({ user }: { user: UserType | undefined }) => {
const { mutate: addSnap, isLoading } = useAddSnap();
const currentUser = getUserState();

const privacyOptions = useMemo(() => ['Everyone can reply', 'Only me'], []);
const privacyOptions = useMemo(
() => ['Everyone can see', 'Only Followers'],
[]
);
const [privacy, setPrivacyOption] = useState<string>(privacyOptions[0]);

useEffect(() => {
Expand Down

0 comments on commit acc55e7

Please sign in to comment.