(ctx context.Context, tabId string, blockIdPrefix string)
| 127 | } |
| 128 | |
| 129 | func ResolveBlockIdFromPrefix(ctx context.Context, tabId string, blockIdPrefix string) (string, error) { |
| 130 | if len(blockIdPrefix) != 8 { |
| 131 | return "", fmt.Errorf("widget_id must be 8 characters") |
| 132 | } |
| 133 | |
| 134 | tab, err := wstore.DBMustGet[*waveobj.Tab](ctx, tabId) |
| 135 | if err != nil { |
| 136 | return "", fmt.Errorf("error getting tab: %w", err) |
| 137 | } |
| 138 | |
| 139 | for _, blockId := range tab.BlockIds { |
| 140 | if strings.HasPrefix(blockId, blockIdPrefix) { |
| 141 | return blockId, nil |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | return "", fmt.Errorf("widget_id not found: %q", blockIdPrefix) |
| 146 | } |
| 147 | |
| 148 | func GoSendNoTelemetryUpdate(telemetryEnabled bool) { |
| 149 | go func() { |
no test coverage detected