Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | 11x 11x 4x 1x 1x 4x 1x 1x 4x 2x 2x 11x 2x 1x 1x 11x 5x 3x 2x 1x 3x 5x 2x 1x 1x 2x 11x 2x 1x 1x 11x | import { FieldValues } from "react-hook-form"; function getSettingsChanges( dirtyFields: { [key: string]: unknown }, data: FieldValues, ) { const changes: { [key: string]: unknown } = {}; if (dirtyFields?.visibility) { if (data?.visibility === "public") { changes.private = false; changes.unlisted = false; } if (data?.visibility === "unlisted") { changes.unlisted = true; changes.private = false; } if (data?.visibility === "private") { changes.private = true; changes.unlisted = false; } } if (dirtyFields?.territory_distribution_status) { if (data?.territory_distribution_status === "all") { changes.whitelist_countries = []; changes.blacklist_countries = []; } } if (data?.territory_distribution_status === "custom") { if (dirtyFields?.whitelist_country_keys) { if ( !data?.whitelist_country_keys || !data?.whitelist_country_keys.length ) { changes.whitelist_countries = []; } else { changes.whitelist_countries = data?.whitelist_country_keys.split(" "); } changes.blacklist_countries = []; } if (dirtyFields?.blacklist_country_keys) { if ( !data?.blacklist_country_keys || !data?.blacklist_country_keys.length ) { changes.blacklist_countries = []; } else { changes.blacklist_countries = data?.blacklist_country_keys.split(" "); } changes.whitelist_countries = []; } } if (dirtyFields?.update_metadata_on_release) { if (data?.update_metadata_on_release) { changes.update_metadata_on_release = "on"; } else { changes.update_metadata_on_release = false; } } return changes; } export default getSettingsChanges; |