maotoumao/MusicFree · info
toast.commmentNotAvaliableForCurrentMusic
Error message
toast.commmentNotAvaliableForCurrentMusic
What it means
Toast shown when the user taps the comment button for a track that does not support comments. supportComment is computed from the current music source; if false, tapping shows this warning (note the misspelled key 'commmentNotAvaliable') and returns without opening the comment panel.
Source
Thrown at src/pages/musicDetail/components/content/albumCover/operations.tsx:104
if (rate !== newRate) {
try {
await TrackPlayer.setRate(newRate / 100);
PersistStatus.set("music.rate", newRate);
} catch { }
}
},
});
}}>
<Image source={ImgAsset.rate[rate!]} style={styles.quality} />
</Pressable>
<Icon
name="chat-bubble-oval-left-ellipsis"
size={iconSizeConst.normal}
color="white"
opacity={supportComment ? 1 : 0.2}
onPress={() => {
if (!supportComment) {
toast.warn(i18n.t("toast.commmentNotAvaliableForCurrentMusic"));
return;
}
if (musicItem) {
showPanel("MusicComment", {
musicItem,
});
}
}}
/>
<Icon
name="ellipsis-vertical"
size={iconSizeConst.normal}
color="white"
onPress={() => {
if (musicItem) {
showPanel("MusicItemOptions", {
musicItem: musicItem,
from: ROUTE_PATH.MUSIC_DETAIL,
View on GitHub (pinned to d118b18b3d)
Solutions
- Use a music source/plugin that supports comments for this track
- Ensure musicItem is loaded before the panel renders so supportComment is computed correctly
- Extend the plugin to implement comment support if comments are desired
Example fix
// before
if (!supportComment) {
toast.warn(i18n.t("toast.commmentNotAvaliableForCurrentMusic"));
return;
}
// after
if (!supportComment || !musicItem) {
toast.warn(i18n.t("toast.commmentNotAvaliableForCurrentMusic"));
return;
} Defensive patterns
Strategy: validation
Validate before calling
if (!supportComment || !musicItem) {
toast.warn(i18n.t('toast.commmentNotAvaliableForCurrentMusic'));
return;
} Type guard
function commentsSupported(m: IMusicItem | null): m is IMusicItem {
return !!m && typeof m.id !== 'undefined' && supportComment === true;
} Prevention
- Compute supportComment only after musicItem loads
- Dim/disable the comment button instead of relying on the toast
- Prefer sources with comment support if comments matter
When it happens
Trigger: Pressing the comment icon while supportComment is false — i.e. the current track's plugin/media source does not implement a comment query for this item.
Common situations: Playing music from a source without comment support (e.g. local files or a minimal plugin); musicItem not yet loaded so support detection defaults to false.
AI-assisted analysis of maotoumao/MusicFree@d118b18b3d (2026-08-30).
Data as JSON: /api/errors/a8c67f74a6cf2c54.
Report an issue: GitHub.