{"record":{"id":"a8c67f74a6cf2c54","repo":"maotoumao/MusicFree","slug":"toast-commmentnotavaliableforcurrentmusic","errorCode":null,"errorMessage":"toast.commmentNotAvaliableForCurrentMusic","messagePattern":"toast\\.commmentNotAvaliableForCurrentMusic","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"src/pages/musicDetail/components/content/albumCover/operations.tsx","lineNumber":104,"sourceCode":"                            if (rate !== newRate) {\r\n                                try {\r\n                                    await TrackPlayer.setRate(newRate / 100);\r\n                                    PersistStatus.set(\"music.rate\", newRate);\r\n                                } catch { }\r\n                            }\r\n                        },\r\n                    });\r\n                }}>\r\n                <Image source={ImgAsset.rate[rate!]} style={styles.quality} />\r\n            </Pressable>\r\n            <Icon\r\n                name=\"chat-bubble-oval-left-ellipsis\"\r\n                size={iconSizeConst.normal}\r\n                color=\"white\"\r\n                opacity={supportComment ? 1 : 0.2}\r\n                onPress={() => {\r\n                    if (!supportComment) {\r\n                        toast.warn(i18n.t(\"toast.commmentNotAvaliableForCurrentMusic\"));\r\n                        return;\r\n                    }\r\n                    if (musicItem) {\r\n                        showPanel(\"MusicComment\", {\r\n                            musicItem,\r\n                        });\r\n                    }\r\n                }}\r\n            />\r\n            <Icon\r\n                name=\"ellipsis-vertical\"\r\n                size={iconSizeConst.normal}\r\n                color=\"white\"\r\n                onPress={() => {\r\n                    if (musicItem) {\r\n                        showPanel(\"MusicItemOptions\", {\r\n                            musicItem: musicItem,\r\n                            from: ROUTE_PATH.MUSIC_DETAIL,\r","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/maotoumao/MusicFree/blob/d118b18b3d0c904400f7eea7bf99c0ceec6c1aee/src/pages/musicDetail/components/content/albumCover/operations.tsx#L86-L122","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nif (!supportComment) {\n    toast.warn(i18n.t(\"toast.commmentNotAvaliableForCurrentMusic\"));\n    return;\n}\n// after\nif (!supportComment || !musicItem) {\n    toast.warn(i18n.t(\"toast.commmentNotAvaliableForCurrentMusic\"));\n    return;\n}","handlingStrategy":"validation","validationCode":"if (!supportComment || !musicItem) {\n    toast.warn(i18n.t('toast.commmentNotAvaliableForCurrentMusic'));\n    return;\n}","typeGuard":"function commentsSupported(m: IMusicItem | null): m is IMusicItem {\n    return !!m && typeof m.id !== 'undefined' && supportComment === true;\n}","tryCatchPattern":null,"preventionTips":["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"],"tags":["comments","feature-support"],"backgroundTag":"feature-unsupported-by-source","analyzedSha":"d118b18b3d0c904400f7eea7bf99c0ceec6c1aee","analyzedAt":"2026-08-30T11:49:12.932Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}