Refactor useSettings hook, parse with zod schema
This commit is contained in:
@ -71,7 +71,7 @@ const EventHeader: React.FC<IEventHeader> = ({ status }) => {
|
||||
const history = useHistory();
|
||||
|
||||
const features = useFeatures();
|
||||
const settings = useSettings();
|
||||
const { boostModal } = useSettings();
|
||||
const { account: ownAccount } = useOwnAccount();
|
||||
const isStaff = ownAccount ? ownAccount.staff : false;
|
||||
const isAdmin = ownAccount ? ownAccount.admin : false;
|
||||
@ -123,7 +123,6 @@ const EventHeader: React.FC<IEventHeader> = ({ status }) => {
|
||||
|
||||
const handleReblogClick = () => {
|
||||
const modalReblog = () => dispatch(toggleReblog(status));
|
||||
const boostModal = settings.get('boostModal');
|
||||
if (!boostModal) {
|
||||
modalReblog();
|
||||
} else {
|
||||
|
||||
@ -28,8 +28,7 @@ const EventInformation: React.FC<IEventInformation> = ({ params }) => {
|
||||
const status = useAppSelector(state => getStatus(state, { id: params.statusId })) as StatusEntity;
|
||||
|
||||
const { tileServer } = useSoapboxConfig();
|
||||
const settings = useSettings();
|
||||
const displayMedia = settings.get('displayMedia') as string;
|
||||
const { displayMedia } = useSettings();
|
||||
|
||||
const [isLoaded, setIsLoaded] = useState<boolean>(!!status);
|
||||
const [showMedia, setShowMedia] = useState<boolean>(defaultMediaVisibility(status, displayMedia));
|
||||
|
||||
Reference in New Issue
Block a user