Skip to content

Commit

Permalink
pr review related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamlangford committed Jul 9, 2024
1 parent 8dd20fa commit bddeca3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/background/messenger/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const recordLog = getNotifier("RECORD_LOG", bg);
export const clearLogs = getMethod("CLEAR_LOGS", bg);
export const clearLog = getMethod("CLEAR_LOG", bg);
export const clearExtensionDebugLogs = getMethod(
"CLEAR_EXTENSION_DEBUG_LOGS",
"CLEAR_MOD_COMPONENT_DEBUG_LOGS",
bg,
);

Expand Down
4 changes: 2 additions & 2 deletions src/background/messenger/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ declare global {
RECORD_ERROR: typeof recordError;
CLEAR_LOGS: typeof clearLogs;
CLEAR_LOG: typeof clearLog;
CLEAR_EXTENSION_DEBUG_LOGS: typeof clearModComponentDebugLogs;
CLEAR_MOD_COMPONENT_DEBUG_LOGS: typeof clearModComponentDebugLogs;

INTEGRATION_REGISTRY_CLEAR: typeof integrationRegistry.clear;
LOCATOR_FIND_ALL_SANITIZED_CONFIGS_FOR_INTEGRATION: typeof integrationConfigLocator.findAllSanitizedConfigsForIntegration;
Expand Down Expand Up @@ -183,7 +183,7 @@ export default function registerMessenger(): void {
RECORD_ERROR: recordError,
CLEAR_LOGS: clearLogs,
CLEAR_LOG: clearLog,
CLEAR_EXTENSION_DEBUG_LOGS: clearModComponentDebugLogs,
CLEAR_MOD_COMPONENT_DEBUG_LOGS: clearModComponentDebugLogs,

INTEGRATION_REGISTRY_CLEAR:
integrationRegistry.clear.bind(integrationRegistry),
Expand Down
6 changes: 3 additions & 3 deletions src/bricks/effects/pageState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ export class SetPageState extends TransformerABC {
}>,
{ logger, platform }: BrickOptions,
): Promise<JsonObject> {
const { modId: blueprintId, modComponentId: extensionId } = logger.context;
const { modId, modComponentId } = logger.context;

return platform.state.setState({
namespace,
data,
mergeStrategy,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-unnecessary-type-assertion -- TODO: https://github.com/pixiebrix/pixiebrix-extension/issues/7891
modComponentId: extensionId!,
modId: blueprintId,
modComponentId: modComponentId!,
modId,
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const useReactivateAction = (modViewItem: ModViewItem): (() => void) | null => {
if (hasModDefinition) {
const modId = isModDefinition(mod) ? mod.metadata.id : mod._recipe?.id;

assertNotNullish(modId, "blueprintId is required to reactivate mod");
assertNotNullish(modId, "modId is required to reactivate mod");

reportEvent(Events.START_MOD_ACTIVATE, {
modId,
Expand Down
2 changes: 2 additions & 0 deletions src/utils/modUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ export function mapModComponentToMessageContext(
/**
* Returns the message context for a ModComponentRef. For use with passing to reportEvent
* @see selectEventData
*
* TODO: Once we update the shape of ModComponentRef, we need to audit unnecessary usage of this function
*/
export function mapModComponentRefToMessageContext(
modComponentRef: ModComponentRef,
Expand Down

0 comments on commit bddeca3

Please sign in to comment.