Skip to content

Commit

Permalink
chore: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Dec 4, 2023
1 parent 8dcf00c commit 2900645
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
15 changes: 11 additions & 4 deletions example/src/advanced/ChannelMetadata/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default function ChannelMetadata() {
const [metadataValue, setMetadataValue] = useState<string>('rtm test');
const [majorRevision, setMajorRevision] = useState<number>(-1);
const [revision, setRevision] = useState<number>(-1);
const [lockName, setLockName] = useState<string>('');

const metadata = useRef<RtmMetadata>(
new RtmMetadata({
Expand Down Expand Up @@ -81,7 +82,6 @@ export default function ChannelMetadata() {
errorCode === RTM_ERROR_CODE.RTM_ERROR_OK
) {
log.alert(`${channelName} metadata:`, `${JSON.stringify(data)}`);
metadata.current = data;
}
},
[]
Expand Down Expand Up @@ -222,7 +222,7 @@ export default function ChannelMetadata() {
RTM_CHANNEL_TYPE.RTM_CHANNEL_TYPE_MESSAGE,
metadata.current,
new MetadataOptions({ recordUserId: true }),
''
lockName
);
};

Expand Down Expand Up @@ -255,7 +255,7 @@ export default function ChannelMetadata() {
RTM_CHANNEL_TYPE.RTM_CHANNEL_TYPE_MESSAGE,
metadata.current,
new MetadataOptions({ recordUserId: true }),
''
lockName
);
};

Expand All @@ -279,7 +279,7 @@ export default function ChannelMetadata() {
RTM_CHANNEL_TYPE.RTM_CHANNEL_TYPE_MESSAGE,
metadata.current,
new MetadataOptions({ recordUserId: true }),
''
lockName
);
};

Expand Down Expand Up @@ -413,6 +413,13 @@ export default function ChannelMetadata() {
label="metadata value"
value={metadataValue}
/>
<AgoraTextInput
onChangeText={(text) => {
setLockName(text);
}}
label="lockName value"
value={lockName}
/>
<AgoraTextInput
onChangeText={(text) => {
if (!text) return;
Expand Down
2 changes: 1 addition & 1 deletion example/src/advanced/Lock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default function Lock() {
errorCode: RTM_ERROR_CODE
) => {
log.info(
'onAcquireLockResult',
'onReleaseLockResult',
'requestId',
requestId,
'channelName',
Expand Down
2 changes: 1 addition & 1 deletion example/src/advanced/StreamChannelLock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function StreamChannelLock() {
errorCode: RTM_ERROR_CODE
) => {
log.info(
'onAcquireLockResult',
'onReleaseLockResult',
'requestId',
requestId,
'channelName',
Expand Down
2 changes: 1 addition & 1 deletion example/src/advanced/publishTopicMessage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default function PublishTopicMessage() {
errorCode: RTM_ERROR_CODE
) => {
log.info(
'onJoinTopicResult',
'onLeaveTopicResult',
'requestId',
requestId,
'channelName',
Expand Down

0 comments on commit 2900645

Please sign in to comment.