minor tweaks
This commit is contained in:
parent
d29b661ccc
commit
667f26e7cd
|
@ -30,4 +30,7 @@ export interface IRoom extends IRocketChatRecord {
|
||||||
usedCannedResponse?: string;
|
usedCannedResponse?: string;
|
||||||
bannerClosed?: boolean;
|
bannerClosed?: boolean;
|
||||||
lastOpen?: Date;
|
lastOpen?: Date;
|
||||||
|
draftMessage?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type IRoomModel = IRoom & Model;
|
||||||
|
|
|
@ -27,7 +27,7 @@ export interface IThread {
|
||||||
edited_by: { username: string };
|
edited_by: { username: string };
|
||||||
reactions: IReaction[];
|
reactions: IReaction[];
|
||||||
role: null;
|
role: null;
|
||||||
drid: null;
|
drid: string;
|
||||||
dcount: null;
|
dcount: null;
|
||||||
dlm: null;
|
dlm: null;
|
||||||
tmid: string;
|
tmid: string;
|
||||||
|
|
|
@ -66,8 +66,9 @@ import UploadProgress from './UploadProgress';
|
||||||
import ReactionPicker from './ReactionPicker';
|
import ReactionPicker from './ReactionPicker';
|
||||||
import List from './List';
|
import List from './List';
|
||||||
import { ChatsStackParamList } from '../../stacks/types';
|
import { ChatsStackParamList } from '../../stacks/types';
|
||||||
import { IRoom, RoomType } from '../../definitions/IRoom';
|
import { IRoom, IRoomModel, RoomType } from '../../definitions/IRoom';
|
||||||
import { IAttachment } from '../../definitions/IAttachment';
|
import { IAttachment } from '../../definitions/IAttachment';
|
||||||
|
import { IThread } from '../../definitions/IThread';
|
||||||
|
|
||||||
const stateAttrsUpdate = [
|
const stateAttrsUpdate = [
|
||||||
'joined',
|
'joined',
|
||||||
|
@ -364,7 +365,8 @@ class RoomView extends React.Component<IRoomViewProps, any> {
|
||||||
this.mounted = false;
|
this.mounted = false;
|
||||||
if (!editing && this.messagebox && this.messagebox.current) {
|
if (!editing && this.messagebox && this.messagebox.current) {
|
||||||
const { text } = this.messagebox.current;
|
const { text } = this.messagebox.current;
|
||||||
let obj: any; // TODO - test the threadsCollection.find return to change this any;
|
let obj: IRoomModel = room; // TODO - test the threadsCollection.find return to change this any;
|
||||||
|
|
||||||
if (this.tmid) {
|
if (this.tmid) {
|
||||||
try {
|
try {
|
||||||
const threadsCollection = db.get('threads');
|
const threadsCollection = db.get('threads');
|
||||||
|
@ -372,13 +374,12 @@ class RoomView extends React.Component<IRoomViewProps, any> {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
obj = room;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj) {
|
if (obj) {
|
||||||
try {
|
try {
|
||||||
await db.action(async () => {
|
await db.action(async () => {
|
||||||
await obj.update((r: any) => {
|
await obj.update(r => {
|
||||||
// TODO - change this any
|
// TODO - change this any
|
||||||
r.draftMessage = text;
|
r.draftMessage = text;
|
||||||
});
|
});
|
||||||
|
@ -742,7 +743,7 @@ class RoomView extends React.Component<IRoomViewProps, any> {
|
||||||
};
|
};
|
||||||
|
|
||||||
onDiscussionPress = debounce(
|
onDiscussionPress = debounce(
|
||||||
(item: any) => {
|
(item: IThread) => {
|
||||||
const { navigation } = this.props;
|
const { navigation } = this.props;
|
||||||
navigation.push('RoomView', {
|
navigation.push('RoomView', {
|
||||||
rid: item.drid,
|
rid: item.drid,
|
||||||
|
|
Loading…
Reference in New Issue