mirror of
https://github.com/wassname/talk.git
synced 2026-07-30 12:40:41 +08:00
[CORL 212] Implement CharCount Restriction feature (#2204)
* feat: adhere to char count settings for posting top level comments * fix: remove bidi characters during test * test: add feature tests for charCount * test: update snapshots * test: add feature test for updating settings * feat: use red color and warn icon (from review) * feat: Implement charCount for reply * feat: charCount for edit comment * test: update snapshots
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { graphql } from "react-relay";
|
||||
import { Environment } from "relay-runtime";
|
||||
|
||||
import { createFetchContainer, fetchQuery } from "talk-framework/lib/relay";
|
||||
import { RefreshSettingsQuery as QueryTypes } from "talk-stream/__generated__/RefreshSettingsQuery.graphql";
|
||||
|
||||
const query = graphql`
|
||||
query RefreshSettingsQuery {
|
||||
settings {
|
||||
...StreamContainer_settings
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
function fetch(environment: Environment) {
|
||||
return fetchQuery<QueryTypes["response"]["settings"]>(
|
||||
environment,
|
||||
query,
|
||||
{},
|
||||
{ force: true }
|
||||
);
|
||||
}
|
||||
|
||||
export const withRefreshSettingsFetch = createFetchContainer(
|
||||
"refreshSettings",
|
||||
fetch
|
||||
);
|
||||
|
||||
export type RefreshSettingsFetch = () => Promise<
|
||||
QueryTypes["response"]["settings"]
|
||||
>;
|
||||
Reference in New Issue
Block a user