Peace be upon you. According to Grand Ayatollah Sayyid Sistani (may Allah protect him), deliberately inhaling thick smoke into the throat is considered a breaker of the fast, and it is obligatory to avoid it. However, inhaling non-thick smoke is permissible. On the other hand, Grand Ayatollah Sayyid Khamenei (may Allah protect him) states that deliberately inhaling thick smoke is not a breaker of the fast, and thus what was mentioned in the question does not invalidate the fast. Nevertheless, it is strongly recommended for the fasting person to avoid smoke from various smoking substances and narcotics that the body absorbs through the nose or under the tongue, including cigarette smoke and other smoking products. If one does this, it is strongly recommended that their fast is invalidated. May you be successful in all good deeds.