|
|
|
@ -17,7 +17,7 @@ import {
|
|
|
|
} from './conversations';
|
|
|
|
} from './conversations';
|
|
|
|
import { getLibMembersPubkeys, useLibGroupName } from './groups';
|
|
|
|
import { getLibMembersPubkeys, useLibGroupName } from './groups';
|
|
|
|
import { getCanWrite, getModerators, getSubscriberCount } from './sogsRoomInfo';
|
|
|
|
import { getCanWrite, getModerators, getSubscriberCount } from './sogsRoomInfo';
|
|
|
|
import { getLibGroupDestroyed, useLibGroupDestroyed } from './userGroups';
|
|
|
|
import { getLibGroupDestroyed, getLibGroupKicked, useLibGroupDestroyed } from './userGroups';
|
|
|
|
|
|
|
|
|
|
|
|
const getIsSelectedPrivate = (state: StateType): boolean => {
|
|
|
|
const getIsSelectedPrivate = (state: StateType): boolean => {
|
|
|
|
return Boolean(getSelectedConversation(state)?.isPrivate) || false;
|
|
|
|
return Boolean(getSelectedConversation(state)?.isPrivate) || false;
|
|
|
|
@ -59,6 +59,7 @@ export const getSelectedConversationIsPublic = (state: StateType): boolean => {
|
|
|
|
export function getSelectedCanWrite(state: StateType) {
|
|
|
|
export function getSelectedCanWrite(state: StateType) {
|
|
|
|
const selectedConvoPubkey = getSelectedConversationKey(state);
|
|
|
|
const selectedConvoPubkey = getSelectedConversationKey(state);
|
|
|
|
const isSelectedGroupDestroyed = getLibGroupDestroyed(state, selectedConvoPubkey);
|
|
|
|
const isSelectedGroupDestroyed = getLibGroupDestroyed(state, selectedConvoPubkey);
|
|
|
|
|
|
|
|
const isSelectedGroupKicked = getLibGroupKicked(state, selectedConvoPubkey);
|
|
|
|
if (!selectedConvoPubkey) {
|
|
|
|
if (!selectedConvoPubkey) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -76,6 +77,7 @@ export function getSelectedCanWrite(state: StateType) {
|
|
|
|
return !(
|
|
|
|
return !(
|
|
|
|
isBlocked ||
|
|
|
|
isBlocked ||
|
|
|
|
isKickedFromGroup ||
|
|
|
|
isKickedFromGroup ||
|
|
|
|
|
|
|
|
isSelectedGroupKicked ||
|
|
|
|
isSelectedGroupDestroyed ||
|
|
|
|
isSelectedGroupDestroyed ||
|
|
|
|
readOnlySogs ||
|
|
|
|
readOnlySogs ||
|
|
|
|
isBlindedAndDisabledMsgRequests
|
|
|
|
isBlindedAndDisabledMsgRequests
|
|
|
|
|